diff --git a/src/deh_tables.c b/src/deh_tables.c index 7d9a913cc..b73c08662 100644 --- a/src/deh_tables.c +++ b/src/deh_tables.c @@ -4687,6 +4687,8 @@ const char *const STATE_LIST[] = { // array length left dynamic for sanity testi "S_RIDEROID", "S_RIDEROID_ICON", + "S_EGGBALL", + "S_DLZHOVER", "S_DLZROCKET_L", "S_DLZROCKET_R", diff --git a/src/info.c b/src/info.c index f7445f536..13081cd12 100644 --- a/src/info.c +++ b/src/info.c @@ -5459,6 +5459,9 @@ state_t states[NUMSTATES] = {SPR_RDRD, 0, -1, {NULL}, 0, 0, S_RIDEROID}, // S_RIDEROID {SPR_RDRC, FF_ANIMATE|FF_FULLBRIGHT|FF_TRANS30, -1, {NULL}, 3, 2, S_RIDEROID_ICON}, // S_RIDEROID_ICON + // Leaf Storm + {SPR_LSZB, 0, -1, {NULL}, 0, 0, S_EGGBALL}, // S_EGGBALL + // Dead Line {SPR_DLZH, 0, -1, {NULL}, 0, 0, S_DLZHOVER}, // S_DLZHOVER @@ -30603,8 +30606,8 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = }, { // MT_LSZ_EGGBALL - -1, // doomednum - S_INVISIBLE, // spawnstate + -1, // doomednum + S_EGGBALL, // spawnstate 1000, // spawnhealth S_NULL, // seestate sfx_None, // seesound @@ -30765,7 +30768,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = }, { // MT_DLZ_RINGVACCUM, - 3443, // doomednum + 3433, // doomednum S_INVISIBLE, // spawnstate 1000, // spawnhealth S_NULL, // seestate diff --git a/src/info.h b/src/info.h index f1429d47e..3400928ed 100644 --- a/src/info.h +++ b/src/info.h @@ -5884,6 +5884,9 @@ typedef enum state S_RIDEROID, S_RIDEROID_ICON, + // leaf storm + S_EGGBALL, + // dead line zone S_DLZHOVER, S_DLZROCKET_L, diff --git a/src/objects/eggball.c b/src/objects/eggball.c index 4a74e3647..81edd1db1 100644 --- a/src/objects/eggball.c +++ b/src/objects/eggball.c @@ -31,12 +31,14 @@ // spawns balls every BALLMINSPAWNTIME to BALLMAXSPAWNTIME seconds. void Obj_EggBallSpawnerThink(mobj_t *mo) { - if (!mo->extravalue1) { mobj_t *ball = P_SpawnMobj(mo->x, mo->y, mo->z, MT_LSZ_EGGBALL); - ball->angle = mo->angle; - P_SetScale(ball, 6*mapobjectscale); + if (P_MobjWasRemoved(ball) == false) + { + ball->angle = mo->angle; + P_SetScale(ball, (ball->destscale = 6*mapobjectscale)); + } mo->extravalue1 = P_RandomRange(PR_TRACKHAZARD, TICRATE*BALLMINSPAWNTIME, TICRATE*BALLMAXSPAWNTIME); } @@ -50,13 +52,17 @@ void Obj_EggBallSpawnerThink(mobj_t *mo) void Obj_EggBallThink(mobj_t *mo) { + const boolean onground = P_IsObjectOnGround(mo); - P_SetScale(mo, 6*mapobjectscale); - - if (mo->eflags & MFE_JUSTHITFLOOR - && mo->threshold) + if (mo->eflags & MFE_JUSTHITFLOOR) { - if (mo->threshold < -10*mapobjectscale) + if (mo->extravalue1 && P_CheckDeathPitCollide(mo)) + { + P_RemoveMobj(mo); + return; + } + + if (mo->threshold && mo->threshold < -10*mapobjectscale) { UINT8 i; @@ -80,17 +86,16 @@ void Obj_EggBallThink(mobj_t *mo) if (!mo->extravalue1) { - if (P_IsObjectOnGround(mo)) + if (onground) { mo->extravalue1 = 1; mo->cusval = 24*mapobjectscale; mo->movedir = mo->z; - mo->sprite = SPR_LSZB; } } else { - if (P_IsObjectOnGround(mo) && mo->extravalue2 &1) + if (onground && (mo->extravalue2 & 1)) { fixed_t dx = mo->x + P_RandomRange(PR_DECORATION, -96, 96)*mapobjectscale - mo->momx*2; fixed_t dy = mo->y + P_RandomRange(PR_DECORATION, -96, 96)*mapobjectscale - mo->momy*2; @@ -107,7 +112,7 @@ void Obj_EggBallThink(mobj_t *mo) mo->frame = mo->extravalue2 % (24 * 2) / 2; // 24 is for frame Y. // build up speed - if (P_IsObjectOnGround(mo)) + if (onground) { if (mo->eflags & MFE_VERTICALFLIP) { @@ -128,7 +133,4 @@ void Obj_EggBallThink(mobj_t *mo) mo->movedir = mo->z; } mo->threshold = mo->momz; - - if (P_CheckDeathPitCollide(mo)) - P_RemoveMobj(mo); }