From a812ef8809b1bb39a75f12f94dd70753cebd6494 Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 18 Jul 2023 17:39:17 +0100 Subject: [PATCH] DMG_WHUMBLE There are two differences between Whumble and Stumble. - Stumble cannot be combo'd on upwards momentum, while whumble can. (Resolves #522) - Whumble takes bumpers, while stumble does not. - Removes the MT_INSTAWHIP hack. --- src/deh_tables.c | 1 + src/k_collide.cpp | 2 +- src/p_inter.c | 21 +++++++++++++-------- src/p_local.h | 1 + 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/deh_tables.c b/src/deh_tables.c index edbb93eba..3be3edeb3 100644 --- a/src/deh_tables.c +++ b/src/deh_tables.c @@ -6550,6 +6550,7 @@ struct int_const_s const INT_CONST[] = { {"DMG_KARMA",DMG_KARMA}, {"DMG_VOLTAGE",DMG_VOLTAGE}, {"DMG_STUMBLE",DMG_STUMBLE}, + {"DMG_WHUMBLE",DMG_WHUMBLE}, //// Death types {"DMG_INSTAKILL",DMG_INSTAKILL}, {"DMG_DEATHPIT",DMG_DEATHPIT}, diff --git a/src/k_collide.cpp b/src/k_collide.cpp index 2f65d1536..4f920ea1e 100644 --- a/src/k_collide.cpp +++ b/src/k_collide.cpp @@ -888,7 +888,7 @@ boolean K_InstaWhipCollide(mobj_t *shield, mobj_t *victim) // while still behaving as if it's a "real" hit. P_PlayRinglossSound(victim); P_PlayerRingBurst(victimPlayer, 5); - P_DamageMobj(victim, shield, attacker, 1, DMG_STUMBLE); // There's a special exception in P_DamageMobj for type==MT_INSTAWHIP + P_DamageMobj(victim, shield, attacker, 1, DMG_WHUMBLE); K_DropPowerUps(victimPlayer); diff --git a/src/p_inter.c b/src/p_inter.c index edc48a28b..6ff23128d 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -2326,7 +2326,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da invincible = false; } - if (invincible && type != DMG_STUMBLE) + if (invincible && type != DMG_STUMBLE && type != DMG_WHUMBLE) { const INT32 oldHitlag = target->hitlag; const INT32 oldHitlagInflictor = inflictor ? inflictor->hitlag : 0; @@ -2384,7 +2384,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da { // Check if we should allow wombo combos (hard hits by default, inverted by the presence of DMG_WOMBO). - boolean allowcombo = ((hardhit || (type == DMG_STUMBLE)) == !(damagetype & DMG_WOMBO)); + boolean allowcombo = ((hardhit || (type == DMG_STUMBLE || type == DMG_WHUMBLE)) == !(damagetype & DMG_WOMBO)); // Tumble/stumble is a special case. if (type == DMG_TUMBLE) @@ -2393,11 +2393,16 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da if (player->tumbleBounces == 1 && (P_MobjFlip(target)*target->momz > 0)) allowcombo = false; } - else if (type == DMG_STUMBLE) + else if (type == DMG_STUMBLE || type == DMG_WHUMBLE) { // don't allow constant combo if (player->tumbleBounces == TUMBLEBOUNCES-1 && (P_MobjFlip(target)*target->momz > 0)) + { + if (type == DMG_STUMBLE) + return false; // No-sell strings of stumble + allowcombo = false; + } } if (allowcombo == false && (target->eflags & MFE_PAUSED)) @@ -2406,7 +2411,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da } // DMG_EXPLODE excluded from flashtic checks to prevent dodging eggbox/SPB with weak spinout - if ((target->hitlag == 0 || allowcombo == false) && player->flashing > 0 && type != DMG_EXPLODE && type != DMG_STUMBLE) + if ((target->hitlag == 0 || allowcombo == false) && player->flashing > 0 && type != DMG_EXPLODE && type != DMG_STUMBLE && type != DMG_WHUMBLE) { // Post-hit invincibility K_DoInstashield(player); @@ -2434,9 +2439,8 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da damage = 0; } - // Instawhip breaks the rules and does "damaging stumble", - // but sting and stumble shouldn't be rewarding Battle hits otherwise. - if ((type == DMG_STING || type == DMG_STUMBLE) && !(inflictor && inflictor->type == MT_INSTAWHIP)) + // Sting and stumble shouldn't be rewarding Battle hits. + if (type == DMG_STING || type == DMG_STUMBLE) { damage = 0; } @@ -2532,6 +2536,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da ringburst = 0; break; case DMG_STUMBLE: + case DMG_WHUMBLE: K_StumblePlayer(player); ringburst = 0; break; @@ -2554,7 +2559,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da break; } - if (type != DMG_STUMBLE) + if (type != DMG_STUMBLE && type != DMG_WHUMBLE) { if (type != DMG_STING) player->flashing = K_GetKartFlashing(player); diff --git a/src/p_local.h b/src/p_local.h index 6b5846145..98168afe2 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -544,6 +544,7 @@ struct BasicFF_t #define DMG_KARMA 0x05 // Karma Bomb explosion -- works like DMG_EXPLODE, but steals half of their bumpers & deletes the rest #define DMG_VOLTAGE 0x06 #define DMG_STUMBLE 0x07 +#define DMG_WHUMBLE 0x08 //// Death types - cannot be combined with damage types #define DMG_INSTAKILL 0x80 #define DMG_DEATHPIT 0x81