37,7 → 37,7 |
move DRAGONSPEED 60 0 |
move DRAGONFLEE 300 0 |
move DRAGONSTOPPED |
move DRAGONBACK -250 0 |
move DRAGONBACK -500 0 |
move DRAGONSHRUNKSPEED 50 0 |
|
ai AIDRAGONFLEE DRAGONBOUNCE DRAGONFLEE fleeenemy randomangle |
97,22 → 97,20 |
} |
ends |
|
|
state dragondeathanglecode |
ifvare temp3 0 |
ifvare temp3 -1 |
{ |
getplayer[THISACTOR].i temp // gets the player's ID |
getactor[temp].x x2 |
getactor[temp].y y2 |
getactor[THISACTOR].x x |
getactor[THISACTOR].y y // gets the coordinates of the player and dragon |
subvarvar x2 x |
subvarvar y2 y |
getangle temp2 x2 y2 // calculates the angle to face the player |
setvar temp 0 |
randvar temp 256 // randomizes the angle within a certain logical range, since the bullet holes are facing the player |
ifrnd 128 addvarvar temp2 temp else subvarvar temp2 temp |
setactor[THISACTOR].ang temp2 // sets the angle, just in time for movement |
setvar temp3 1 |
getactor[THISACTOR].htang temp // get the angle of the projectile that hit the dragon |
ifvarg temp 1024 subvar temp 1024 else addvar temp 1024 // turn the angle around to face the projectile |
|
setvar temp2 0 |
randvar temp2 128 // randomizes the angle within a certain logical range, since the bullet holes are facing the player |
ifrnd 128 addvarvar temp temp2 else subvarvar temp temp2 |
|
getactor[THISACTOR].ang temp3 // pass this along to EVENT_ANIMATESPRITES |
|
setactor[THISACTOR].ang temp // sets the angle, just in time for movement |
} |
ends |
|
175,6 → 173,7 |
{ |
ifrnd 100 |
{ |
ifcansee nullop else ai AIDRAGONBOUNCESEE // This line should make the dragon smarter. |
resetcount |
resetactioncount |
} |
224,8 → 223,8 |
} |
else |
{ |
state dragondeathanglecode |
ai AIDRAGONDYING |
state dragondeathanglecode |
} |
|
sound BALLEXPLODE |
290,7 → 289,14 |
useractor enemy DRAGON DRAGONSTRENGTH DRAGONBOUNCE |
fall |
cstator 257 |
setactor[THISACTOR].mdflags 16 |
|
ifai 0 |
{ |
setvar temp3 -1 |
ai AIDRAGONBOUNCE |
} |
|
state checksquished |
|
ifaction DRAGONDEAD |
302,6 → 308,7 |
spawn TRANSPORTERSTAR |
cstat 257 |
strength DRAGONSTRENGTH |
setvar temp3 -1 |
ai AIDRAGONBOUNCE |
} |
else |
353,10 → 360,9 |
break |
} |
|
ifhitweapon state DRAGONHITSTATE |
ifhitweapon |
state DRAGONHITSTATE |
|
ifai 0 ai AIDRAGONBOUNCE |
|
ifai AIDRAGONGROW state dragongrowstate |
else ifai AIDRAGONSHRUNK state DRAGONSHRINKSTATE |
else |
373,7 → 379,26 |
enda |
|
useractor notenemy DRAGONDEATH 0 |
setvar temp3 -1 |
setactor[THISACTOR].mdflags 16 |
|
addvar temp 1 |
ifvare temp 1 |
{ |
getplayer[THISACTOR].i temp2 // get the player's ID |
|
// get the coordinates of the player and dragon |
getactor[temp2].x x2 |
getactor[temp2].y y2 |
getactor[THISACTOR].x x |
getactor[THISACTOR].y y |
|
subvarvar x2 x |
subvarvar y2 y |
getangle y x2 y2 // calculates the angle to face the player |
|
setactor[THISACTOR].htang y |
} |
ifvare temp 26 |
{ |
setvar temp 0 |