// ========== Vortex A.I. (v1.1)==========
// written by Lord Bruges (FoD)
// for Project Quest (17/02/1999)
// email:
[email protected]
//
http://www.geocities.com/TimesSquare/9901/FoD/
//
//modified by sardon for 1.22
//modified by king dan for chaos continuum
//
// Below are variables which modify
// the vortex's behavior. Press PgDn
// to view them all.
//
// thanx to King Dan for the islinked idea
//
if (playerenters) {timereverywhere; timeout=.05;
if(playerscount=1){
hearts=1; //the number of hearts the vortex starts with
this.delay=0; //the pause between each attack
this.durtn=4; //the duration of each attack
loopspeed=.05; //the speed the AI loops
pulldist=.2; //the distance covered by each pull
this.power=0; //number of half hearts it drains when it gets the player
this.islinked=0; //0=no; 1or2=linked to AttackBlock: 1=Vortex On, ABs OFF; 2=Vortex On, Abs ON
}}
//do not edit anything below this
// line!!
//-----------------------------------
if (playerenters) {this.attacking=0; this.t=0;}
if (playertouchsme && this.active>0) {
if (x>playerx) {if (!onwall(playerx+.5-.5,playery+.5)) playerx=playerx-.5;if (!onwall(playerx+.5-.5,playery+.5)) playerx=playerx-.5;};
if (x<playerx) {if (!onwall(playerx+.5+.5,playery+.5)) playerx=playerx+.5;if (!onwall(playerx+.5+.5,playery+.5)) playerx=playerx+.5;};
if (y>playery) {if (!onwall(playerx+.5,playery+.5-.5)) playery=playery-.5;if (!onwall(playerx+.5,playery+.5-.5)) playery=playery-.5;};
if (y<playery) {if (!onwall(playerx+.5,playery+.5+.5)) playery=playery+.5;if (!onwall(playerx+.5,playery+.5+.5)) playery=playery+.5;};
};
if (x-playerx<1 && playerx-x<1 && y-playery<1 && playery-y<1 && this.active>0) {
if (x>playerx) {if (!onwall(playerx+.5-.5,playery+.5)) playerx=playerx-.5;if (!onwall(playerx+.5-.5,playery+.5)) playerx=playerx-.5;};
if (x<playerx) {if (!onwall(playerx+.5+.5,playery+.5)) playerx=playerx+.5;if (!onwall(playerx+.5+.5,playery+.5)) playerx=playerx+.5;};
if (y>playery) {if (!onwall(playerx+.5,playery+.5-.5)) playery=playery-.5;if (!onwall(playerx+.5,playery+.5-.5)) playery=playery-.5;};
if (y<playery) {if (!onwall(playerx+.5,playery+.5+.5)) playery=playery+.5;if (!onwall(playerx+.5,playery+.5+.5)) playery=playery+.5;};
};
if (hearts>0) {
if (this.attacking=1){this.t=this.t+loopspeed;
if (playerdir<3) {playerdir+=1} else {playerdir=0};
if (x<playerx) {playerx=playerx-pulldist};
if (x>playerx) {playerx=playerx+pulldist};
if (y<playery) {playery=playery-pulldist};
if (y>playery) {playery=playery+pulldist};}
if (this.t>=this.durtn) {this.t=0; this.attacking=0; this.image=1; }
if (this.islinked=2) set SHOOTING;
if (this.islinked=1) unset SHOOTING;
timeout=loopspeed;
}
if (this.attacking=0){this.t=this.t+loopspeed;
if (this.t>=this.delay) {this.t=0; this.attacking=1;}
if (this.islinked=1) set SHOOTING;
if (this.islinked=2) unset SHOOTING;
timeout=loopspeed;
}
if (timeout && this.active<1 && hearts>0) {this.active=1; timeout=0.1;show;}
//================================================== ===================