name	 	RattlerB
health		300
type		enemy
nomove		1 1
nodrop		2
nopain		1
nodieblink	2
death		1
antigravity	100
animationscript	data/chars/cobras/jetsc.c
takedamagescript data/scripts/blink.c

load		RatBomb
load		RatBomb2

palette		data/chars/cobras/rattler.png
alternatepal	data/chars/cobras/ratblink.png


anim spawn
	delay	1
	offset	125 50
	frame	data/chars/cobras/rattler.png
	delay	180
	@cmd	dasher 4 0 0 1
	frame	data/chars/cobras/rattler.png
	delay	400
	@cmd	flip
	@cmd	dasher 0 0 0 0
	frame	data/chars/cobras/rattler.png

anim idle
	loop    1
	delay	10
	offset	125 50
	frame	data/chars/cobras/rattler.png
	@cmd	attack0 "ANI_FOLLOW1"
	frame	data/chars/cobras/rattler.png

anim follow1 #Mini Bombing
@script
    if(frame==0){
      void vSelf = getlocalvar("self");
      int r = rand()%30;

      if( r > 0){
        changeentityproperty(vSelf, "animation", openborconstant("ANI_FOLLOW2"));
      }
    }
@end_script
	loop	1
	delay	1
	offset	125 50
	frame	data/chars/cobras/rattler.png
	delay	40
	bbox	16 29 204 22
	@cmd	move 0 0 40
	@cmd	dasher 4 0 0 1
	frame	data/chars/cobras/rattler.png
	delay	35
	sound	data/sounds/grenadefall.wav
	@cmd	spawn01 "RatBomb2" 0 -10 0
	frame	data/chars/cobras/rattler.png
	sound	data/sounds/grenadefall.wav
	@cmd	spawn01 "RatBomb2" 0 -10 0
	frame	data/chars/cobras/rattler.png
	sound	data/sounds/grenadefall.wav
	@cmd	spawn01 "RatBomb2" 0 -10 0
	frame	data/chars/cobras/rattler.png
	sound	data/sounds/grenadefall.wav
	@cmd	spawn01 "RatBomb2" 0 -10 0
	frame	data/chars/cobras/rattler.png
	delay	800
	bbox	0
	@cmd	flip
	@cmd	move 0 0 -40
	@cmd	dasher 0 0 0 0
	frame	data/chars/cobras/rattler.png

anim follow2 #Big Bombing
@script
    if(frame==0){
      void vSelf = getlocalvar("self");
      int r = rand()%30;

      if( r > 0){
        changeentityproperty(vSelf, "animation", openborconstant("ANI_FOLLOW1"));
      }
    }
@end_script
	loop	1
	delay	1
	offset	125 50
	frame	data/chars/cobras/rattler.png
	delay	40
	@cmd	dasher 4 0 0 1
	bbox	16 29 204 22
	frame	data/chars/cobras/rattler.png
	delay	70
	sound	data/sounds/grenadefall.wav
	@cmd	shooter2 "RatBomb" 0 -10 0 -2
	frame	data/chars/cobras/rattler.png
	delay	70
	sound	data/sounds/grenadefall.wav
	@cmd	shooter2 "RatBomb" 0 -10 0 -2
	frame	data/chars/cobras/rattler.png
	delay	400
	bbox	0
	@cmd	flip
	@cmd	dasher 0 0 0 0
	frame	data/chars/cobras/rattler.png


anim death
	delay	1
	offset	125 50
	frame	data/chars/cobras/rattler.png
	delay	10
	@cmd	dasher 2 -1 0 1
	@cmd	spawn01 "Asap" 30 9 1
	@cmd	spawn01 "Asap" 90 9 1
	@cmd	spawn01 "Asap" -30 9 1
	frame	data/chars/cobras/rattler.png
	@cmd	spawn01 "Asap" -60 9 1
	@cmd	spawn01 "Asap" 0 9 1
	@cmd	spawn01 "Asap" -120 9 1
	frame	data/chars/cobras/rattler.png
	@cmd	spawn01 "Asap" 60 9 1
	@cmd	spawn01 "Asap" -90 9 1
	frame	data/chars/cobras/rattler.png #
	@cmd	spawn01 "Asap" 30 9 1
	@cmd	spawn01 "Asap" 90 9 1
	@cmd	spawn01 "Asap" -30 9 1
	frame	data/chars/cobras/rattler.png
	@cmd	spawn01 "Asap" -60 9 1
	@cmd	spawn01 "Asap" 0 9 1
	@cmd	spawn01 "Asap" -120 9 1
	frame	data/chars/cobras/rattler.png
	@cmd	spawn01 "Asap" 60 9 1
	@cmd	spawn01 "Asap" -90 9 1
	frame	data/chars/cobras/rattler.png #
	@cmd	spawn01 "Asap" 30 9 1
	@cmd	spawn01 "Asap" 90 9 1
	@cmd	spawn01 "Asap" -30 9 1
	frame	data/chars/cobras/rattler.png
	@cmd	spawn01 "Asap" -60 9 1
	@cmd	spawn01 "Asap" 0 9 1
	@cmd	spawn01 "Asap" -120 9 1
	frame	data/chars/cobras/rattler.png
	@cmd	spawn01 "Asap" 60 9 1
	@cmd	spawn01 "Asap" -90 9 1
	frame	data/chars/cobras/rattler.png #
	@cmd	spawn01 "Asap" 30 9 1
	@cmd	spawn01 "Asap" 90 9 1
	@cmd	spawn01 "Asap" -30 9 1
	frame	data/chars/cobras/rattler.png
	@cmd	spawn01 "Asap" -60 9 1
	@cmd	spawn01 "Asap" 0 9 1
	@cmd	spawn01 "Asap" -120 9 1
	frame	data/chars/cobras/rattler.png
	@cmd	spawn01 "Asap" 60 9 1
	@cmd	spawn01 "Asap" -90 9 1
	frame	data/chars/cobras/rattler.png #
	@cmd	spawn01 "Asap" 30 9 1
	@cmd	spawn01 "Asap" 90 9 1
	@cmd	spawn01 "Asap" -30 9 1
	frame	data/chars/cobras/rattler.png
	@cmd	spawn01 "Asap" -60 9 1
	@cmd	spawn01 "Asap" 0 9 1
	@cmd	spawn01 "Asap" -120 9 1
	frame	data/chars/cobras/rattler.png
	@cmd	spawn01 "Asap" 60 9 1
	@cmd	spawn01 "Asap" -90 9 1
	frame	data/chars/cobras/rattler.png #
	@cmd	spawn01 "Asap" 30 9 1
	@cmd	spawn01 "Asap" 90 9 1
	@cmd	spawn01 "Asap" -30 9 1
	frame	data/chars/cobras/rattler.png
	@cmd	spawn01 "Asap" -60 9 1
	@cmd	spawn01 "Asap" 0 9 1
	@cmd	spawn01 "Asap" -120 9 1
	frame	data/chars/cobras/rattler.png
	@cmd	spawn01 "Asap" 60 9 1
	@cmd	spawn01 "Asap" -90 9 1
	frame	data/chars/cobras/rattler.png #
	@cmd	suicide
	frame	data/chars/cobras/rattler.png
