From f9c6a5e8b5d1870c5505dc91a27462263556a740 Mon Sep 17 00:00:00 2001 From: James R Date: Sat, 6 Feb 2021 02:31:24 -0800 Subject: [PATCH] Drop Funny Spikes when getting stung DEBTA0-DEBTH0 Instead of dropping rings, drop non collectable spikes! --- src/dehacked.c | 17 +++++++++++++++++ src/info.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ src/info.h | 17 +++++++++++++++++ src/p_inter.c | 31 +++++++++++++++++++++---------- src/p_mobj.c | 6 ++++++ 5 files changed, 105 insertions(+), 10 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index e151b18ab..16e29d22b 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -9414,6 +9414,22 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_FINISHBEAMEND1", "S_FINISHBEAMEND2", + // Funny Spike + "S_DEBTSPIKE1", + "S_DEBTSPIKE2", + "S_DEBTSPIKE3", + "S_DEBTSPIKE4", + "S_DEBTSPIKE5", + "S_DEBTSPIKE6", + "S_DEBTSPIKE7", + "S_DEBTSPIKE8", + "S_DEBTSPIKE9", + "S_DEBTSPIKEA", + "S_DEBTSPIKEB", + "S_DEBTSPIKEC", + "S_DEBTSPIKED", + "S_DEBTSPIKEE", + #ifdef SEENAMES "S_NAMECHECK", #endif @@ -9553,6 +9569,7 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s // Collectible Items "MT_RING", "MT_FLINGRING", // Lost ring + "MT_DEBTSPIKE", // Ring debt funny spike "MT_BLUESPHERE", // Blue sphere for special stages "MT_FLINGBLUESPHERE", // Lost blue sphere "MT_BOMBSPHERE", diff --git a/src/info.c b/src/info.c index 5e6060dd6..82dfa7add 100644 --- a/src/info.c +++ b/src/info.c @@ -131,6 +131,7 @@ char sprnames[NUMSPRITES + 1][5] = // Collectible Items "RING", + "DEBT", "TRNG", // Team Rings "TOKE", // Special Stage Token "RFLG", // Red CTF Flag @@ -5126,6 +5127,22 @@ state_t states[NUMSTATES] = {SPR_FLBM, FF_PAPERSPRITE|5, 1, {NULL}, 0, 0, S_NULL}, // S_FINISHBEAMEND1 {SPR_FLBM, FF_PAPERSPRITE|6, 1, {NULL}, 0, 0, S_NULL}, // S_FINISHBEAMEND2 + // Funny Spike + {SPR_DEBT, 0|FF_FULLBRIGHT, 1, {NULL}, 0, 0, S_DEBTSPIKE2}, // S_DEBTSPIKE1 + {SPR_DEBT, 7|FF_FULLBRIGHT, 1, {NULL}, 0, 0, S_DEBTSPIKE3}, // S_DEBTSPIKE2 + {SPR_DEBT, 1|FF_FULLBRIGHT, 1, {NULL}, 0, 0, S_DEBTSPIKE4}, // S_DEBTSPIKE3 + {SPR_DEBT, 7|FF_FULLBRIGHT, 1, {NULL}, 0, 0, S_DEBTSPIKE5}, // S_DEBTSPIKE4 + {SPR_DEBT, 2|FF_FULLBRIGHT, 1, {NULL}, 0, 0, S_DEBTSPIKE6}, // S_DEBTSPIKE5 + {SPR_DEBT, 7|FF_FULLBRIGHT, 1, {NULL}, 0, 0, S_DEBTSPIKE7}, // S_DEBTSPIKE6 + {SPR_DEBT, 3|FF_FULLBRIGHT, 1, {NULL}, 0, 0, S_DEBTSPIKE8}, // S_DEBTSPIKE7 + {SPR_DEBT, 7|FF_FULLBRIGHT, 1, {NULL}, 0, 0, S_DEBTSPIKE9}, // S_DEBTSPIKE8 + {SPR_DEBT, 4|FF_FULLBRIGHT, 1, {NULL}, 0, 0, S_DEBTSPIKEA}, // S_DEBTSPIKE9 + {SPR_DEBT, 7|FF_FULLBRIGHT, 1, {NULL}, 0, 0, S_DEBTSPIKEB}, // S_DEBTSPIKEA + {SPR_DEBT, 5|FF_FULLBRIGHT, 1, {NULL}, 0, 0, S_DEBTSPIKEC}, // S_DEBTSPIKEB + {SPR_DEBT, 7|FF_FULLBRIGHT, 1, {NULL}, 0, 0, S_DEBTSPIKED}, // S_DEBTSPIKEC + {SPR_DEBT, 6|FF_FULLBRIGHT, 1, {NULL}, 0, 0, S_DEBTSPIKEE}, // S_DEBTSPIKED + {SPR_DEBT, 7|FF_FULLBRIGHT, 1, {NULL}, 0, 0, S_DEBTSPIKE1}, // S_DEBTSPIKEE + #ifdef SEENAMES {SPR_NULL, 0, 1, {NULL}, 0, 0, S_NULL}, // S_NAMECHECK #endif @@ -8022,6 +8039,33 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, + { // MT_DEBTSPIKE + -1, // doomednum + S_DEBTSPIKE1, // spawnstate + 1000, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + MT_FLINGRING, // reactiontime + sfx_None, // attacksound + S_NULL, // painstate + MT_RING, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_SPRK1, // deathstate + S_NULL, // xdeathstate + sfx_itemup, // deathsound + 38*FRACUNIT, // speed + 24*FRACUNIT, // radius + 48*FRACUNIT, // height + 0, // display offset + 100, // mass + 0, // damage + sfx_None, // activesound + MF_DONTENCOREMAP, // flags + S_NULL // raisestate + }, + { // MT_BLUESPHERE -1, // doomednum S_BLUESPHERE_SPAWN, // spawnstate diff --git a/src/info.h b/src/info.h index 2c7a3ed23..17b111c55 100644 --- a/src/info.h +++ b/src/info.h @@ -402,6 +402,7 @@ typedef enum sprite // Collectible Items SPR_RING, + SPR_DEBT, SPR_TRNG, // Team Rings SPR_TOKE, // Special Stage Token SPR_RFLG, // Red CTF Flag @@ -5281,6 +5282,21 @@ typedef enum state S_FINISHBEAMEND1, S_FINISHBEAMEND2, + S_DEBTSPIKE1, + S_DEBTSPIKE2, + S_DEBTSPIKE3, + S_DEBTSPIKE4, + S_DEBTSPIKE5, + S_DEBTSPIKE6, + S_DEBTSPIKE7, + S_DEBTSPIKE8, + S_DEBTSPIKE9, + S_DEBTSPIKEA, + S_DEBTSPIKEB, + S_DEBTSPIKEC, + S_DEBTSPIKED, + S_DEBTSPIKEE, + #ifdef SEENAMES S_NAMECHECK, #endif @@ -5440,6 +5456,7 @@ typedef enum mobj_type // Collectible Items MT_RING, MT_FLINGRING, // Lost ring + MT_DEBTSPIKE, // Ring debt funny spike MT_BLUESPHERE, // Blue sphere for special stages MT_FLINGBLUESPHERE, // Lost blue sphere MT_BOMBSPHERE, diff --git a/src/p_inter.c b/src/p_inter.c index 5be3cc736..deb79df4a 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -2115,6 +2115,9 @@ void P_PlayerRingBurst(player_t *player, INT32 num_rings) fixed_t ns; fixed_t z; fixed_t momxy = 5<mo->scale; // Rings shouldn't be in Battle! if (gametyperules & GTR_SPHERES) @@ -2134,9 +2137,19 @@ void P_PlayerRingBurst(player_t *player, INT32 num_rings) else if (num_rings <= 0) return; - // Cap the maximum loss automatically to 2 in ring debt - if (player->rings <= 0 && num_rings > 2) - num_rings = 2; + if (player->rings <= 0) + { + // In ring debt, spill the Funny Spikes + objType = MT_DEBTSPIKE; + objFuse = 90; + + objScale = 3 * objScale / 2; + } + else + { + objType = MT_FLINGRING; + objFuse = 60*TICRATE; + } P_GivePlayerRings(player, -num_rings); @@ -2145,8 +2158,6 @@ void P_PlayerRingBurst(player_t *player, INT32 num_rings) for (i = 0; i < num_rings; i++) { - INT32 objType = mobjinfo[MT_RING].reactiontime; - z = player->mo->z; if (player->mo->eflags & MFE_VERTICALFLIP) z += player->mo->height - mobjinfo[objType].height; @@ -2154,11 +2165,11 @@ void P_PlayerRingBurst(player_t *player, INT32 num_rings) mo = P_SpawnMobj(player->mo->x, player->mo->y, z, objType); mo->threshold = 10; - mo->fuse = 60*TICRATE; + mo->fuse = objFuse; P_SetTarget(&mo->target, player->mo); - mo->destscale = player->mo->scale; - P_SetScale(mo, player->mo->scale); + mo->destscale = objScale; + P_SetScale(mo, objScale); // Angle / height offset changes every other ring if (i != 0) @@ -2172,11 +2183,11 @@ void P_PlayerRingBurst(player_t *player, INT32 num_rings) fa += ANGLE_180; } - ns = FixedMul(momxy, mo->scale); + ns = FixedMul(momxy, player->mo->scale); mo->momx = (mo->target->momx/2) + FixedMul(FINECOSINE(fa>>ANGLETOFINESHIFT), ns); mo->momy = (mo->target->momy/2) + FixedMul(FINESINE(fa>>ANGLETOFINESHIFT), ns); - ns = FixedMul(momz, mo->scale); + ns = FixedMul(momz, player->mo->scale); P_SetObjectMomZ(mo, (mo->target->momz/2) + ns, false); if (player->mo->eflags & MFE_VERTICALFLIP) diff --git a/src/p_mobj.c b/src/p_mobj.c index 2cbabfd9a..f4f14c663 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -2280,6 +2280,11 @@ boolean P_ZMovement(mobj_t *mo) else mo->flags2 ^= MFD_DONTDRAW; } + else if (mo->type == MT_DEBTSPIKE) + { + mom.x = mom.y = 0; + mom.z = -mom.z/2; + } else if (mo->flags & MF_MISSILE) { if (!(mo->flags & MF_NOCLIP)) @@ -9124,6 +9129,7 @@ static void P_DefaultMobjShadowScale(mobj_t *thing) thing->shadowscale = FRACUNIT; break; case MT_RING: + case MT_DEBTSPIKE: case MT_FLOATINGITEM: case MT_BLUESPHERE: case MT_EMERALD: