diff --git a/src/ai/earth.cpp b/src/ai/earth.cpp index 017a49b6d..eaf575eca 100644 --- a/src/ai/earth.cpp +++ b/src/ai/earth.cpp @@ -2,6 +2,8 @@ #include "../include/enemyai.h" +#include "earth.h" + // explosion and earth chunk objects, used for the "earth explodes" // sequence when you press the switch on a Tantalus Ray in ep2. @@ -26,7 +28,7 @@ void explosion_ai(int o) { if (objects[o].ai.ray.direction==-1 && objects[o].ai.ray.animframe==0) { - objects[o].exists = 0; + delete_object(o); } else { @@ -55,7 +57,7 @@ void earthchunk_ai(int o) objects[o].inhibitfall = 1; objects[o].needinit = 0; } - if (!objects[o].onscreen) objects[o].exists = 0; + if (!objects[o].onscreen) delete_object(o); switch(objects[o].ai.ray.direction) { diff --git a/src/ai/fireball.cpp b/src/ai/fireball.cpp index 267a166a2..94bc1ef25 100644 --- a/src/ai/fireball.cpp +++ b/src/ai/fireball.cpp @@ -5,11 +5,12 @@ #include "../include/enemyai.h" #include "../sdl/sound/CSound.h" +#include "fireball.h" // fireball projectile shot out by Vorticon Mother (Ep3) -#define FIREBALL_SPEED 5 - +#define FIREBALL_SPEED 8 +#define FIREBALL_HARD_SPEED 19 #define FIREBALL_ANIM_RATE 80 #define FIREBALL_LEFT_FRAME 57 @@ -17,9 +18,10 @@ #define FIREBALL_OFFSCREEN_KILL_TIME 100 -void fireball_ai(int o, stCloneKeenPlus *pCKP) +void fireball_ai(int o, bool hard) { - int i; +int i; +int speed; if (objects[o].needinit) { objects[o].ai.ray.animframe = 0; @@ -30,36 +32,43 @@ void fireball_ai(int o, stCloneKeenPlus *pCKP) objects[o].needinit = 0; } - // test if it hit a baddie - for(i=1;i FIREBALL_OFFSCREEN_KILL_TIME) { - objects[o].exists = 0; + delete_object(o); return; } else objects[o].ai.ray.offscreentime++; @@ -87,6 +96,7 @@ void fireball_ai(int o, stCloneKeenPlus *pCKP) else objects[o].ai.ray.offscreentime = 0; // fly through the air + speed = hard ? FIREBALL_HARD_SPEED : FIREBALL_SPEED; if (objects[o].ai.ray.direction == RIGHT) { objects[o].sprite = FIREBALL_RIGHT_FRAME + objects[o].ai.ray.animframe; @@ -98,7 +108,7 @@ void fireball_ai(int o, stCloneKeenPlus *pCKP) objects[o].needinit = 0; return; } - else objects[o].x += FIREBALL_SPEED; + else objects[o].x += speed; } else { @@ -111,7 +121,7 @@ void fireball_ai(int o, stCloneKeenPlus *pCKP) objects[o].needinit = 0; return; } - else objects[o].x -= FIREBALL_SPEED; + else objects[o].x -= speed; } // animation @@ -123,3 +133,5 @@ void fireball_ai(int o, stCloneKeenPlus *pCKP) else objects[o].ai.ray.animtimer++; } + + diff --git a/src/gamedo.cpp b/src/gamedo.cpp index 91924075d..817102267 100644 --- a/src/gamedo.cpp +++ b/src/gamedo.cpp @@ -283,7 +283,7 @@ int i; case OBJ_MEEP: meep_ai(i, pCKP->Control.levelcontrol); break; case OBJ_SNDWAVE: sndwave_ai(i, pCKP); break; case OBJ_MOTHER: mother_ai(i, pCKP->Control.levelcontrol); break; - case OBJ_FIREBALL: fireball_ai(i, pCKP); break; + case OBJ_FIREBALL: fireball_ai(i, pCKP->Control.levelcontrol.hardmode); break; case OBJ_BALL: ballandjack_ai(i); break; case OBJ_JACK: ballandjack_ai(i); break; case OBJ_PLATVERT: platvert_ai(i); break; diff --git a/src/include/enemyai.h b/src/include/enemyai.h index 474c94717..1cc6c1687 100644 --- a/src/include/enemyai.h +++ b/src/include/enemyai.h @@ -32,7 +32,7 @@ void ninja_ai(int o, stCloneKeenPlus *pCKP); void meep_ai(int o, stLevelControl levelcontrol); void sndwave_ai(int o, stCloneKeenPlus *pCKP); void mother_ai(int o, stLevelControl levelcontrol); -void fireball_ai(int o, stCloneKeenPlus *pCKP); +void fireball_ai(int o, bool hard); void ballandjack_ai(int o); void platvert_ai(int o); void nessie_ai(int o);