diff --git a/src/ai/butler.cpp b/src/ai/butler.cpp index 696d47e8c..3c6cb8274 100644 --- a/src/ai/butler.cpp +++ b/src/ai/butler.cpp @@ -39,8 +39,10 @@ char not_about_to_fall; objects[o].ai.butler.movedir = RIGHT; objects[o].ai.butler.animtimer = 0; objects[o].canbezapped = 1; // will stop bullets but are not harmed + //objects[o].inhibitfall = 1; objects[o].needinit = 0; - objects[o].x -= 16; + //objects[o].x -= 16; + objects[o].x -= 4; } // push keen if (objects[o].touchPlayer && !player[objects[o].touchedBy].pdie) @@ -87,7 +89,6 @@ char not_about_to_fall; { // move left not_about_to_fall = TileProperty[getmaptileat((objects[o].x>>CSF)-BUTLER_LOOK_AHEAD_DIST, (objects[o].y>>CSF)+sprites[BUTLER_WALK_LEFT_FRAME].ysize)][BUP]; - //not_about_to_fall = tiles[getmaptileat((objects[o].x>>CSF)-BUTLER_LOOK_AHEAD_DIST, (objects[o].y>>CSF)+sprites[BUTLER_WALK_LEFT_FRAME].ysize)].solidfall; objects[o].sprite = BUTLER_WALK_LEFT_FRAME + objects[o].ai.butler.frame; if (!objects[o].blockedl && not_about_to_fall) { @@ -109,7 +110,6 @@ char not_about_to_fall; { // move right not_about_to_fall = TileProperty[getmaptileat((objects[o].x>>CSF)+sprites[BUTLER_WALK_RIGHT_FRAME].xsize+BUTLER_LOOK_AHEAD_DIST, (objects[o].y>>CSF)+sprites[BUTLER_WALK_RIGHT_FRAME].ysize)][BUP]; - //not_about_to_fall = tiles[getmaptileat((objects[o].x>>CSF)+sprites[BUTLER_WALK_RIGHT_FRAME].xsize+BUTLER_LOOK_AHEAD_DIST, (objects[o].y>>CSF)+sprites[BUTLER_WALK_RIGHT_FRAME].ysize)].solidfall; objects[o].sprite = BUTLER_WALK_RIGHT_FRAME + objects[o].ai.butler.frame; if (!objects[o].blockedr && not_about_to_fall) { diff --git a/src/ai/door.cpp b/src/ai/door.cpp index 286cc2da9..797f056d1 100644 --- a/src/ai/door.cpp +++ b/src/ai/door.cpp @@ -1,6 +1,6 @@ #include "../keen.h" -#include "../include/enemyai.h" +#include "door.h" // "AI" for the door object (to do the animation when a door // opens, the door tiles are removed and replaced with a sprite @@ -9,7 +9,7 @@ #define DOOR_OPEN_SPEED 10 -void door_ai(int o) +/*void door_ai(int o) { if (objects[o].needinit) { @@ -30,4 +30,29 @@ void door_ai(int o) else objects[o].ai.door.distance_traveled++; objects[o].ai.door.timer = 0; } else objects[o].ai.door.timer++; +}*/ + +void door_ai(int o, char DoorOpenDir) +{ + if (objects[o].needinit) + { + objects[o].ai.door.timer = 0; + sprites[objects[o].sprite].ysize = 32; + objects[o].inhibitfall = 1; + objects[o].needinit = 0; + } + + if (objects[o].ai.door.timer > DOOR_OPEN_SPEED) + { + // TODO: Create a flag for mods in which the door can be opened in another direction + /*if (DoorOpenDir==DOWN)*/ objects[o].y += (1< than "extra life at" and award 1-UPs when appropriate void extralifeat(int cp) { diff --git a/src/gamedo.cpp b/src/gamedo.cpp index 2df4c453d..8c14e3d9d 100644 --- a/src/gamedo.cpp +++ b/src/gamedo.cpp @@ -258,7 +258,7 @@ int i; case OBJ_BUTLER: butler_ai(i, pCKP->Control.levelcontrol.hardmode); break; case OBJ_TANK: tank_ai(i, pCKP->Control.levelcontrol.hardmode); break; case OBJ_RAY: ray_ai(i, pCKP, pCKP->Control.levelcontrol); break; - case OBJ_DOOR: door_ai(i); break; + case OBJ_DOOR: door_ai(i, pCKP->Control.levelcontrol.cepvars.DoorOpenDir); break; case OBJ_ICECHUNK: icechunk_ai(i); break; case OBJ_ICEBIT: icebit_ai(i); break; case OBJ_TELEPORTER: teleporter_ai(i, pCKP->Control.levelcontrol); break; diff --git a/src/include/declarations.h b/src/include/declarations.h index 065108c50..770ecbca4 100644 --- a/src/include/declarations.h +++ b/src/include/declarations.h @@ -64,6 +64,16 @@ struct stLevelControl // as long as we only have POD stLevelControl() { memset(this, 0, sizeof(stLevelControl)); } + + // stuff for custom episode's options + struct + { + char DoorOpenDir; + char pShotSpeed; + char VortDieDoFade; + char vgatiles; + char vgasprites; + } cepvars; }; diff --git a/src/include/enemyai.h b/src/include/enemyai.h index 432f26278..474c94717 100644 --- a/src/include/enemyai.h +++ b/src/include/enemyai.h @@ -13,9 +13,9 @@ void vort_ai(int o, stCloneKeenPlus *pCKP, stLevelControl levelcontrol); void butler_ai(int o, bool hardmode); void tank_ai(int o, bool hardmode); void ray_ai(int o, stCloneKeenPlus *pCKP, stLevelControl levelcontrol); -void door_ai(int o); void icechunk_ai(int o); void icebit_ai(int o); +void door_ai(int o, char DoorOpenDir); void teleporter_ai(int o, stLevelControl levelcontrol); void rope_ai(int o); // ep2