name		WingEnd
type		none
offscreenkill	10000
subject_to_gravity 0
palette		data/chars/misc/arrowdn.png
animationscript	data/scripts/enemy.c

load		WingsD

anim follow1
@script
    void self = getlocalvar("self");
    float x = getentityproperty(self, "x");
    float y = getentityproperty(self, "a");
    void P1 = getplayerproperty(0, "entity");

    if(P1){
      float Px = getentityproperty(P1, "x");
      float Py = getentityproperty(P1, "a");

      if(x>=Px-35 && x<=Px+35 && y>=Py-10 && y<=Py+5){
        jumptobranch("End",1);
      }
    }
@end_script
        loop    1 2 8
	delay	7
	offset	16 36
	frame	data/chars/misc/empty.gif
	@cmd	spawn02 "WingsD" 0 252 0
	frame	data/chars/misc/empty.gif
	frame	data/chars/misc/arrowdn.png
	frame	data/chars/misc/arrowdn.png
	frame	data/chars/misc/arrowdn.png
	frame	data/chars/misc/empty.gif
	frame	data/chars/misc/empty.gif
	frame	data/chars/misc/empty.gif
	frame	data/chars/misc/empty.gif

anim idle
@script
    void self = getlocalvar("self");
    int Enemy = openborvariant("count_enemies");

    if(Enemy==0){
      playmusic("data/music/wingsC.bor",1);
      performattack(self, openborconstant("ANI_FOLLOW1"));
    }
@end_script
        loop    1
	delay	10
	offset	16 36
	frame	data/chars/misc/empty.gif
	frame	data/chars/misc/empty.gif
