From 892f6eca27775d11a44ada4cf0ce013aba890674 Mon Sep 17 00:00:00 2001 From: toaster Date: Fri, 15 Nov 2019 14:52:34 +0000 Subject: [PATCH] Make ACZ3's slapstick signpost taller (resolves #267). --- src/dehacked.c | 1 + src/info.c | 7 ++++--- src/info.h | 1 + src/p_enemy.c | 15 ++++++++++++--- src/p_map.c | 25 +++++++++++++------------ 5 files changed, 31 insertions(+), 18 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index fff9dbee8..ead4ce1be 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -5343,6 +5343,7 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_FSGNA", "S_FSGNB", "S_FSGNC", + "S_FSGND", // Black Eggman (Boss 7) "S_BLACKEGG_STND", diff --git a/src/info.c b/src/info.c index ed29fe2bf..daa9ae61b 100644 --- a/src/info.c +++ b/src/info.c @@ -1487,6 +1487,7 @@ state_t states[NUMSTATES] = {SPR_FSGN, 0|FF_PAPERSPRITE, -1, {NULL}, 0, 0, S_NULL}, // S_FSGNA {SPR_FSGN, 1|FF_PAPERSPRITE, -1, {NULL}, 0, 0, S_NULL}, // S_FSGNB {SPR_FSGN, 2|FF_PAPERSPRITE, -1, {NULL}, 0, 0, S_NULL}, // S_FSGNC + {SPR_FSGN, 3|FF_PAPERSPRITE, -1, {NULL}, 0, 0, S_NULL}, // S_FSGND // Black Eggman (Boss 7) {SPR_BRAK, 0, 1, {A_SetReactionTime}, 0, 0, S_BLACKEGG_STND2}, // S_BLACKEGG_STND @@ -6115,11 +6116,11 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL, // meleestate S_NULL, // missilestate S_FSGNC, // deathstate - S_NULL, // xdeathstate + S_FSGND, // xdeathstate sfx_None, // deathsound 0, // speed - 124*FRACUNIT, // radius - 640*FRACUNIT, // height + 74*FRACUNIT, // radius + 320*FRACUNIT, // height 0, // display offset 0, // mass 0, // damage diff --git a/src/info.h b/src/info.h index bbb6a21fc..5dac56529 100644 --- a/src/info.h +++ b/src/info.h @@ -1657,6 +1657,7 @@ typedef enum state S_FSGNA, S_FSGNB, S_FSGNC, + S_FSGND, // Black Eggman (Boss 7) S_BLACKEGG_STND, diff --git a/src/p_enemy.c b/src/p_enemy.c index eedbecaa7..03f9c6b42 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -4070,19 +4070,28 @@ bossjustdie: mobj_t *pole = P_SpawnMobj( mo->tracer->x - P_ReturnThrustX(mo->tracer, mo->tracer->angle, speed*time), mo->tracer->y - P_ReturnThrustY(mo->tracer, mo->tracer->angle, speed*time), - mo->tracer->floorz + 4*FRACUNIT, + mo->tracer->floorz + (256+1)*FRACUNIT, MT_FSGNB); P_SetTarget(&pole->tracer, P_SpawnMobj( + pole->x, pole->y, + pole->z - 256*FRACUNIT, + MT_FSGNB)); + P_SetTarget(&pole->tracer->tracer, P_SpawnMobj( pole->x + P_ReturnThrustX(pole, mo->tracer->angle, FRACUNIT), pole->y + P_ReturnThrustY(pole, mo->tracer->angle, FRACUNIT), pole->z + 256*FRACUNIT, MT_FSGNA)); - pole->angle = mo->tracer->angle; - pole->tracer->angle = pole->angle - ANGLE_90; + pole->tracer->flags |= MF_NOCLIPTHING; + P_SetScale(pole, (pole->destscale = 2*FRACUNIT)); + P_SetScale(pole->tracer, (pole->tracer->destscale = 2*FRACUNIT)); + pole->angle = pole->tracer->angle = mo->tracer->angle; + pole->tracer->tracer->angle = pole->angle - ANGLE_90; pole->momx = P_ReturnThrustX(pole, pole->angle, speed); pole->momy = P_ReturnThrustY(pole, pole->angle, speed); pole->tracer->momx = pole->momx; pole->tracer->momy = pole->momy; + pole->tracer->tracer->momx = pole->momx; + pole->tracer->tracer->momy = pole->momy; } } else diff --git a/src/p_map.c b/src/p_map.c index bb56a50b1..26aeca7d0 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -661,31 +661,32 @@ static void P_SlapStick(mobj_t *fang, mobj_t *pole) momx2 = fang->momx/dist; momy2 = fang->momy/dist; - pole->tracer->momx = momx1 + (dist-1)*momx2; - pole->tracer->momy = momy1 + (dist-1)*momy2; + pole->tracer->tracer->momx = momx1 + (dist-1)*momx2; + pole->tracer->tracer->momy = momy1 + (dist-1)*momy2; fang->momx = (dist-1)*momx1 + momx2; fang->momy = (dist-1)*momy1 + momy2; #undef dist - P_SetMobjState(pole, pole->info->deathstate); - - P_SetObjectMomZ(pole->tracer, 6*FRACUNIT, false); - pole->tracer->flags &= ~(MF_NOGRAVITY|MF_NOCLIP); - pole->tracer->movedir = ANGLE_67h; - if ((R_PointToAngle(fang->x - pole->tracer->x, fang->y - pole->tracer->y) - pole->angle) > ANGLE_180) - pole->tracer->movedir = InvAngle(pole->tracer->movedir); + P_SetObjectMomZ(pole->tracer->tracer, 6*FRACUNIT, false); + pole->tracer->tracer->flags &= ~(MF_NOGRAVITY|MF_NOCLIP); + pole->tracer->tracer->movedir = ANGLE_67h; + if ((R_PointToAngle(fang->x - pole->tracer->tracer->x, fang->y - pole->tracer->tracer->y) - pole->angle) > ANGLE_180) + pole->tracer->tracer->movedir = InvAngle(pole->tracer->movedir); P_SetObjectMomZ(fang, 14*FRACUNIT, false); fang->flags |= MF_NOGRAVITY|MF_NOCLIP; P_SetMobjState(fang, fang->info->xdeathstate); - pole->tracer->tics = pole->tics = fang->tics; + pole->tracer->tracer->tics = pole->tracer->tics = pole->tics = fang->tics; var1 = var2 = 0; - A_Scream(pole->tracer); + A_Scream(pole->tracer->tracer); S_StartSound(fang, sfx_altdi1); + P_SetTarget(&pole->tracer->tracer, NULL); + P_SetMobjState(pole->tracer, pole->info->xdeathstate); P_SetTarget(&pole->tracer, NULL); + P_SetMobjState(pole, pole->info->deathstate); } static void P_PlayerBarrelCollide(mobj_t *toucher, mobj_t *barrel) @@ -1089,7 +1090,7 @@ static boolean PIT_CheckThing(mobj_t *thing) return true; // overhead if (thing->z + thing->height < tmthing->z) return true; // underneath - if (!thing->tracer) + if (!thing->tracer || !thing->tracer->tracer) return true; P_SlapStick(tmthing, thing); // no return value was used in the original prototype script at this point,