name		 Zartan
health		 500
nomove		 1 1
type		 enemy
death		 1
nopain		 1
nodrop		 2
nodieblink	 2
gfxshadow	 1
subject_to_hole  0
diesound	 data/sounds/die4.wav
hostile		 player npc
candamage	 player npc

animationscript	 data/scripts/harden.c
takedamagescript data/scripts/blink.c


palette		 data/chars/Zartan/idle.png
alternatepal	 data/chars/Zartan/blink.png


load		 grenade
load		 Peluru

	
anim	spawn
drawmethod 220 220
	delay	180
	offset	90 115
	jumpframe 0 0 4 0
	frame	data/chars/Zartan/idle.png
	delay	150
	@cmd	flip
	@cmd	dasher 0 0 0
	frame	data/chars/Zartan/idle.png
#	delay	180
	delay	160
	@cmd	dasher 3 0 0
	frame	data/chars/Zartan/idle.png
	delay	50
	@cmd	dasher 0 0 0
	frame	data/chars/Zartan/idle.png


anim	idle
drawmethod 220 220
	loop	1
	delay	25
	offset	90 115
	bbox	51 9 61 80
	frame	data/chars/Zartan/idle.png
	@cmd	attack0 "ANI_ATTACK1"
	frame	data/chars/Zartan/idle.png
		
anim	walk
drawmethod 220 220
	loop	1
	delay	25
	offset	90 115
	bbox	51 9 61 80
	frame	data/chars/Zartan/idle.png


anim	attack1
@script
    void self = getlocalvar("self");

    if( frame == 0){
      int r = rand()%30;

      if( r > 0){
        changeentityproperty(self, "animation", openborconstant("ANI_FOLLOW1"));
      }
    } else if( frame == 9){
      int s = rand()%30;

      if( s > 0){
        changeentityproperty(self, "animation", openborconstant("ANI_FOLLOW2"));
      }
    }
@end_script
drawmethod 220 220
	delay	1
	offset	90 115
	bbox	51 9 61 80
	frame	data/chars/Zartan/idle.png
	delay	80
	@cmd	dasher 3 0 0
	frame	data/chars/Zartan/idle.png
	delay	50
	bbox	0
	@cmd	flip
	@cmd	dasher 0 0 0
	frame	data/chars/Zartan/idle.png
	delay	60
	@cmd	dasher 2 0 0
	frame	data/chars/Zartan/idle.png
	delay	20
	bbox	51 9 61 80
	sound	data/sounds/gun.wav
	@cmd	shoot "Peluru" 40 65 0
	frame	data/chars/Zartan/shoot.png
	frame	data/chars/Zartan/idle.png
	sound	data/sounds/gun.wav
	@cmd	shoot "Peluru" 40 65 0
	frame	data/chars/Zartan/shoot.png
	delay	160
	@cmd	dasher 3 0 0
	frame	data/chars/Zartan/idle.png
	bbox	0
	delay	50
	@cmd	flip
	@cmd	dasher 0 0 0
	frame	data/chars/Zartan/idle.png
	delay	1
	frame	data/chars/Zartan/idle.png
	delay	20
	sound	data/sounds/gun.wav
	@cmd	shoot "Peluru" 40 65 0
	frame	data/chars/Zartan/shoot.png
	frame	data/chars/Zartan/idle.png
	delay	30
	@cmd	dasher 3 0 0
	frame	data/chars/Zartan/idle.png
	delay	130
	bbox	51 9 61 80
	frame	data/chars/Zartan/idle.png
	delay	50
	@cmd	dasher 0 0 0
	frame	data/chars/Zartan/idle.png
	delay	10
	@cmd	beidle
	frame	data/chars/Zartan/idle.png

anim	follow2
drawmethod 220 220
	delay	1
	offset	90 115
	frame	data/chars/Zartan/idle.png
	delay	40
	@cmd	dasher 3 0 0
	frame	data/chars/Zartan/idle.png
	delay	30
	bbox	51 9 61 80
	@cmd	tosser "Grenade" 28 106 1 0 6 0
	frame	data/chars/Zartan/toss.png
	frame	data/chars/Zartan/idle.png
	@cmd	tosser "Grenade" 28 106 1 0 6 0
	frame	data/chars/Zartan/toss.png
	frame	data/chars/Zartan/idle.png
	delay	50
	@cmd	dasher 0 0 0
	frame	data/chars/Zartan/idle.png
	delay	10
	@cmd	beidle
	frame	data/chars/Zartan/idle.png

anim	follow1
drawmethod 220 220
	delay	1
	offset	90 115
	bbox	51 9 61 80
	frame	data/chars/Zartan/idle.png
	frame	data/chars/Zartan/idle.png
	delay	60
	@cmd	dasher 1 0 0
	frame	data/chars/Zartan/idle.png
	delay	20
	@cmd	targetL 6 30 0 0
	frame	data/chars/Zartan/idle.png
	@cmd	dasher -1 0 0
	@cmd	tossT "Grenade" 28 106 0 6
	frame	data/chars/Zartan/toss.png
	delay	60
	frame	data/chars/Zartan/idle.png
	frame	data/chars/Zartan/idle.png
	delay	20
	@cmd	targetL 6 -35 0 0
	frame	data/chars/Zartan/idle.png
	@cmd	dasher 1 0 0
	@cmd	tossT "Grenade" 28 106 0 6
	frame	data/chars/Zartan/toss.png
	delay	60
	frame	data/chars/Zartan/idle.png
	delay	10
	@cmd	dasher 0 0 0
	@cmd	looper 1 2
	frame	data/chars/Zartan/idle.png
	@cmd	beidle
	frame	data/chars/Zartan/idle.png




anim	death
@script
    void self = getlocalvar("self");

    if( frame == 0){
      changeentityproperty(self, "velocity", -1.5);
    }
@end_script
drawmethod 220 220
	delay	10
#	jumpframe	0 0 -1.5 0
	offset	90 115
	frame	data/chars/Zartan/dead.png
	delay	300
	frame	data/chars/Zartan/dead.png
	@cmd	suicide
	frame	data/chars/Zartan/dead.png
		
anim	fall
drawmethod 220 220
	delay	30
	offset	90 115
	frame	data/chars/Zartan/dead.png
		
anim	pain
drawmethod 220 220
	delay	28
	offset	90 115
	frame	data/chars/Zartan/dead.png
	
anim	rise
drawmethod 220 220
	delay	5
	offset	90 115
	frame	data/chars/Zartan/dead.png
