Make Grow cause stumble

This commit is contained in:
Sally Coolatta 2022-09-24 16:13:44 -04:00
parent f970e82109
commit eedff2dea9
3 changed files with 34 additions and 10 deletions

View file

@ -862,23 +862,46 @@ 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 = (t1->scale > t2->scale + (mapobjectscale/8))
|| (t1->player->invincibilitytimer > 0)
|| (t1->player->flamedash > 0 && t1->player->itemtype == KITEM_FLAMESHIELD);
if ((t1Condition == true || flameT1 == true) && (t2Condition == true || flameT2 == true))
t2Condition = (t2->scale > t1->scale + (mapobjectscale/8))
|| (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 stumble on scale difference
t1Condition = (t1->scale > t2->scale + (mapobjectscale/8));
t2Condition = (t2->scale > t1->scale + (mapobjectscale/8));
if (t1Condition == true && t2Condition == false)
{
K_StumblePlayer(t2->player);
return true;
}
else if (t1Condition == false && t2Condition == true)
{
K_StumblePlayer(t1->player);
return true;
}
// 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 +913,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)
{

View file

@ -4005,7 +4005,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);

View file

@ -86,6 +86,7 @@ void K_SpinPlayer(player_t *player, mobj_t *inflictor, mobj_t *source, INT32 typ
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);