diff --git a/src/k_botsearch.c b/src/k_botsearch.c index 74a458bce..26fc9f73d 100644 --- a/src/k_botsearch.c +++ b/src/k_botsearch.c @@ -501,8 +501,8 @@ static BlockItReturn_t K_FindObjectsForNudging(mobj_t *thing) // There REALLY ought to be a better way to handle this logic, right?! // Squishing if (K_PlayerAttackSteer(thing, side, 20, - globalsmuggle.botmo->scale > thing->scale + (mapobjectscale/8), - thing->scale > globalsmuggle.botmo->scale + (mapobjectscale/8) + K_IsBigger(globalsmuggle.botmo, thing), + K_IsBigger(thing, globalsmuggle.botmo) )) { break; diff --git a/src/k_collide.c b/src/k_collide.c index 9d582da59..a373af5c2 100644 --- a/src/k_collide.c +++ b/src/k_collide.c @@ -758,8 +758,10 @@ boolean K_BubbleShieldCollide(mobj_t *t1, mobj_t *t2) if (P_PlayerInPain(t2->player) || t2->player->flashing || t2->player->hyudorotimer - || t2->player->justbumped || t2->scale > t1->scale + (mapobjectscale/8)) + || t2->player->justbumped || K_IsBigger(t2, t1)) + { return true; + } // Player Damage P_DamageMobj(t2, ((t1->type == MT_BUBBLESHIELD) ? t1->target : t1), t1, 1, DMG_NORMAL|DMG_WOMBO); @@ -852,7 +854,7 @@ boolean K_SMKIceBlockCollide(mobj_t *t1, mobj_t *t2) /* if (t2->player && (t2->player->invincibilitytimer > 0 - || t2->player->growshrinktimer > 0)) + || K_IsBigger(t2, t1) == true)) return true; */ @@ -862,23 +864,31 @@ boolean K_SMKIceBlockCollide(mobj_t *t1, mobj_t *t2) boolean K_PvPTouchDamage(mobj_t *t1, mobj_t *t2) { - const boolean flameT1 = (t1->player->flamedash > 0 && t1->player->itemtype == KITEM_FLAMESHIELD); - const boolean flameT2 = (t2->player->flamedash > 0 && t2->player->itemtype == KITEM_FLAMESHIELD); - boolean t1Condition = false; boolean t2Condition = false; boolean stungT1 = false; boolean stungT2 = false; - t1Condition = (t1->scale > t2->scale + (mapobjectscale/8)) || (t1->player->invincibilitytimer > 0); - t2Condition = (t2->scale > t1->scale + (mapobjectscale/8)) || (t2->player->invincibilitytimer > 0); + // Clash instead of damage if both parties have any of these conditions + t1Condition = (K_IsBigger(t1, t2) == true) + || (t1->player->invincibilitytimer > 0) + || (t1->player->flamedash > 0 && t1->player->itemtype == KITEM_FLAMESHIELD); - if ((t1Condition == true || flameT1 == true) && (t2Condition == true || flameT2 == true)) + t2Condition = (K_IsBigger(t2, t1) == true) + || (t2->player->invincibilitytimer > 0) + || (t2->player->flamedash > 0 && t2->player->itemtype == KITEM_FLAMESHIELD); + + if (t1Condition == true && t2Condition == true) { K_DoPowerClash(t1->player, t2->player); return false; } - else if (t1Condition == true && t2Condition == false) + + // Cause tumble on invincibility + t1Condition = (t1->player->invincibilitytimer > 0); + t2Condition = (t2->player->invincibilitytimer > 0); + + if (t1Condition == true && t2Condition == false) { P_DamageMobj(t2, t1, t1, 1, DMG_TUMBLE); return true; @@ -890,8 +900,8 @@ boolean K_PvPTouchDamage(mobj_t *t1, mobj_t *t2) } // Flame Shield dash damage - t1Condition = flameT1; - t2Condition = flameT2; + t1Condition = (t1->player->flamedash > 0 && t1->player->itemtype == KITEM_FLAMESHIELD); + t2Condition = (t2->player->flamedash > 0 && t2->player->itemtype == KITEM_FLAMESHIELD); if (t1Condition == true && t2Condition == false) { @@ -927,6 +937,21 @@ boolean K_PvPTouchDamage(mobj_t *t1, mobj_t *t2) } } + // Cause stumble on scale difference + t1Condition = K_IsBigger(t1, t2); + t2Condition = K_IsBigger(t2, t1); + + if (t1Condition == true && t2Condition == false) + { + K_StumblePlayer(t2->player); + return true; + } + else if (t1Condition == false && t2Condition == true) + { + K_StumblePlayer(t1->player); + return true; + } + // Ring sting, this is a bit more unique t1Condition = (K_GetShieldFromItem(t2->player->itemtype) == KSHIELD_NONE); t2Condition = (K_GetShieldFromItem(t1->player->itemtype) == KSHIELD_NONE); diff --git a/src/k_kart.c b/src/k_kart.c index 5d9faf36f..ad93fdb75 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -1409,7 +1409,7 @@ fixed_t K_GetMobjWeight(mobj_t *mobj, mobj_t *against) case MT_FALLINGROCK: if (against->player) { - if (against->player->invincibilitytimer || against->player->growshrinktimer > 0) + if (against->player->invincibilitytimer || K_IsBigger(against, mobj) == true) weight = 0; else weight = K_PlayerWeight(against, NULL); @@ -3935,6 +3935,17 @@ void K_RemoveGrowShrink(player_t *player) P_RestoreMusic(player); } +boolean K_IsBigger(mobj_t *compare, mobj_t *other) +{ + if ((compare == NULL || P_MobjWasRemoved(compare) == true) + || (other == NULL || P_MobjWasRemoved(other) == true)) + { + return false; + } + + return (compare->scale > other->scale + (mapobjectscale / 4)); +} + static fixed_t K_TumbleZ(mobj_t *mo, fixed_t input) { // Scales base tumble gravity to FRACUNIT @@ -4005,7 +4016,7 @@ angle_t K_StumbleSlope(angle_t angle, angle_t pitch, angle_t roll) return slope; } -static void K_StumblePlayer(player_t *player) +void K_StumblePlayer(player_t *player) { P_ResetPlayer(player); diff --git a/src/k_kart.h b/src/k_kart.h index a3f7dae0c..b120f0b6c 100644 --- a/src/k_kart.h +++ b/src/k_kart.h @@ -82,10 +82,12 @@ void K_DoInstashield(player_t *player); void K_DoPowerClash(player_t *t1, player_t *t2); void K_BattleAwardHit(player_t *player, player_t *victim, mobj_t *inflictor, UINT8 bumpersRemoved); void K_RemoveGrowShrink(player_t *player); +boolean K_IsBigger(mobj_t *compare, mobj_t *other); void K_SpinPlayer(player_t *player, mobj_t *inflictor, mobj_t *source, INT32 type); void K_TumblePlayer(player_t *player, mobj_t *inflictor, mobj_t *source); void K_TumbleInterrupt(player_t *player); angle_t K_StumbleSlope(angle_t angle, angle_t pitch, angle_t roll); +void K_StumblePlayer(player_t *player); boolean K_CheckStumble(player_t *player, angle_t oldPitch, angle_t oldRoll, boolean fromAir); void K_InitStumbleIndicator(player_t *player); void K_UpdateStumbleIndicator(player_t *player); diff --git a/src/p_inter.c b/src/p_inter.c index b11c269e0..4974338bb 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -387,7 +387,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) // kill if (player->invincibilitytimer > 0 - || player->growshrinktimer > 0 + || K_IsBigger(toucher, special) == true || player->flamedash > 0) { P_KillMobj(special, toucher, toucher, DMG_NORMAL); @@ -1926,7 +1926,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da } } - if (player->invincibilitytimer > 0 || player->growshrinktimer > 0 || player->hyudorotimer > 0) + if (player->invincibilitytimer > 0 || K_IsBigger(target, inflictor) == true || player->hyudorotimer > 0) { // Full invulnerability K_DoInstashield(player); diff --git a/src/p_map.c b/src/p_map.c index 5b1827988..619f8698a 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -1368,7 +1368,7 @@ static BlockItReturn_t PIT_CheckThing(mobj_t *thing) return BMIT_CONTINUE; // dead if (tmthing->player->invincibilitytimer > 0 - || tmthing->player->growshrinktimer > 0) + || K_IsBigger(tmthing, thing) == true) { if (thing->type == MT_BLUEROBRA_JOINT) P_KillMobj(thing->target, tmthing, tmthing, DMG_NORMAL); @@ -1394,7 +1394,7 @@ static BlockItReturn_t PIT_CheckThing(mobj_t *thing) return BMIT_CONTINUE; // dead if (tmthing->player->invincibilitytimer > 0 - || tmthing->player->growshrinktimer > 0) + || K_IsBigger(tmthing, thing) == true) { P_KillMobj(thing, tmthing, tmthing, DMG_NORMAL); return BMIT_CONTINUE; // kill @@ -1425,7 +1425,7 @@ static BlockItReturn_t PIT_CheckThing(mobj_t *thing) // kill if (tmthing->player->invincibilitytimer > 0 - || tmthing->player->growshrinktimer > 0) + || K_IsBigger(tmthing, thing) == true) { P_KillMobj(thing, tmthing, tmthing, DMG_NORMAL); return BMIT_CONTINUE;