mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-27 12:31:54 +00:00
Merge branch 'grow-stumbles' into 'master'
Grow/Shrink cleanup See merge request KartKrew/Kart!703
This commit is contained in:
commit
bf25bb6d85
6 changed files with 58 additions and 20 deletions
|
|
@ -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?!
|
// There REALLY ought to be a better way to handle this logic, right?!
|
||||||
// Squishing
|
// Squishing
|
||||||
if (K_PlayerAttackSteer(thing, side, 20,
|
if (K_PlayerAttackSteer(thing, side, 20,
|
||||||
globalsmuggle.botmo->scale > thing->scale + (mapobjectscale/8),
|
K_IsBigger(globalsmuggle.botmo, thing),
|
||||||
thing->scale > globalsmuggle.botmo->scale + (mapobjectscale/8)
|
K_IsBigger(thing, globalsmuggle.botmo)
|
||||||
))
|
))
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -758,8 +758,10 @@ boolean K_BubbleShieldCollide(mobj_t *t1, mobj_t *t2)
|
||||||
|
|
||||||
if (P_PlayerInPain(t2->player)
|
if (P_PlayerInPain(t2->player)
|
||||||
|| t2->player->flashing || t2->player->hyudorotimer
|
|| t2->player->flashing || t2->player->hyudorotimer
|
||||||
|| t2->player->justbumped || t2->scale > t1->scale + (mapobjectscale/8))
|
|| t2->player->justbumped || K_IsBigger(t2, t1))
|
||||||
|
{
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
// Player Damage
|
// Player Damage
|
||||||
P_DamageMobj(t2, ((t1->type == MT_BUBBLESHIELD) ? t1->target : t1), t1, 1, DMG_NORMAL|DMG_WOMBO);
|
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
|
if (t2->player && (t2->player->invincibilitytimer > 0
|
||||||
|| t2->player->growshrinktimer > 0))
|
|| K_IsBigger(t2, t1) == true))
|
||||||
return 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)
|
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 t1Condition = false;
|
||||||
boolean t2Condition = false;
|
boolean t2Condition = false;
|
||||||
boolean stungT1 = false;
|
boolean stungT1 = false;
|
||||||
boolean stungT2 = false;
|
boolean stungT2 = false;
|
||||||
|
|
||||||
t1Condition = (t1->scale > t2->scale + (mapobjectscale/8)) || (t1->player->invincibilitytimer > 0);
|
// Clash instead of damage if both parties have any of these conditions
|
||||||
t2Condition = (t2->scale > t1->scale + (mapobjectscale/8)) || (t2->player->invincibilitytimer > 0);
|
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);
|
K_DoPowerClash(t1->player, t2->player);
|
||||||
return false;
|
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);
|
P_DamageMobj(t2, t1, t1, 1, DMG_TUMBLE);
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -890,8 +900,8 @@ boolean K_PvPTouchDamage(mobj_t *t1, mobj_t *t2)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Flame Shield dash damage
|
// Flame Shield dash damage
|
||||||
t1Condition = flameT1;
|
t1Condition = (t1->player->flamedash > 0 && t1->player->itemtype == KITEM_FLAMESHIELD);
|
||||||
t2Condition = flameT2;
|
t2Condition = (t2->player->flamedash > 0 && t2->player->itemtype == KITEM_FLAMESHIELD);
|
||||||
|
|
||||||
if (t1Condition == true && t2Condition == false)
|
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
|
// Ring sting, this is a bit more unique
|
||||||
t1Condition = (K_GetShieldFromItem(t2->player->itemtype) == KSHIELD_NONE);
|
t1Condition = (K_GetShieldFromItem(t2->player->itemtype) == KSHIELD_NONE);
|
||||||
t2Condition = (K_GetShieldFromItem(t1->player->itemtype) == KSHIELD_NONE);
|
t2Condition = (K_GetShieldFromItem(t1->player->itemtype) == KSHIELD_NONE);
|
||||||
|
|
|
||||||
15
src/k_kart.c
15
src/k_kart.c
|
|
@ -1409,7 +1409,7 @@ fixed_t K_GetMobjWeight(mobj_t *mobj, mobj_t *against)
|
||||||
case MT_FALLINGROCK:
|
case MT_FALLINGROCK:
|
||||||
if (against->player)
|
if (against->player)
|
||||||
{
|
{
|
||||||
if (against->player->invincibilitytimer || against->player->growshrinktimer > 0)
|
if (against->player->invincibilitytimer || K_IsBigger(against, mobj) == true)
|
||||||
weight = 0;
|
weight = 0;
|
||||||
else
|
else
|
||||||
weight = K_PlayerWeight(against, NULL);
|
weight = K_PlayerWeight(against, NULL);
|
||||||
|
|
@ -3935,6 +3935,17 @@ void K_RemoveGrowShrink(player_t *player)
|
||||||
P_RestoreMusic(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)
|
static fixed_t K_TumbleZ(mobj_t *mo, fixed_t input)
|
||||||
{
|
{
|
||||||
// Scales base tumble gravity to FRACUNIT
|
// 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;
|
return slope;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void K_StumblePlayer(player_t *player)
|
void K_StumblePlayer(player_t *player)
|
||||||
{
|
{
|
||||||
P_ResetPlayer(player);
|
P_ResetPlayer(player);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -82,10 +82,12 @@ void K_DoInstashield(player_t *player);
|
||||||
void K_DoPowerClash(player_t *t1, player_t *t2);
|
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_BattleAwardHit(player_t *player, player_t *victim, mobj_t *inflictor, UINT8 bumpersRemoved);
|
||||||
void K_RemoveGrowShrink(player_t *player);
|
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_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_TumblePlayer(player_t *player, mobj_t *inflictor, mobj_t *source);
|
||||||
void K_TumbleInterrupt(player_t *player);
|
void K_TumbleInterrupt(player_t *player);
|
||||||
angle_t K_StumbleSlope(angle_t angle, angle_t pitch, angle_t roll);
|
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);
|
boolean K_CheckStumble(player_t *player, angle_t oldPitch, angle_t oldRoll, boolean fromAir);
|
||||||
void K_InitStumbleIndicator(player_t *player);
|
void K_InitStumbleIndicator(player_t *player);
|
||||||
void K_UpdateStumbleIndicator(player_t *player);
|
void K_UpdateStumbleIndicator(player_t *player);
|
||||||
|
|
|
||||||
|
|
@ -387,7 +387,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
||||||
|
|
||||||
// kill
|
// kill
|
||||||
if (player->invincibilitytimer > 0
|
if (player->invincibilitytimer > 0
|
||||||
|| player->growshrinktimer > 0
|
|| K_IsBigger(toucher, special) == true
|
||||||
|| player->flamedash > 0)
|
|| player->flamedash > 0)
|
||||||
{
|
{
|
||||||
P_KillMobj(special, toucher, toucher, DMG_NORMAL);
|
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
|
// Full invulnerability
|
||||||
K_DoInstashield(player);
|
K_DoInstashield(player);
|
||||||
|
|
|
||||||
|
|
@ -1368,7 +1368,7 @@ static BlockItReturn_t PIT_CheckThing(mobj_t *thing)
|
||||||
return BMIT_CONTINUE; // dead
|
return BMIT_CONTINUE; // dead
|
||||||
|
|
||||||
if (tmthing->player->invincibilitytimer > 0
|
if (tmthing->player->invincibilitytimer > 0
|
||||||
|| tmthing->player->growshrinktimer > 0)
|
|| K_IsBigger(tmthing, thing) == true)
|
||||||
{
|
{
|
||||||
if (thing->type == MT_BLUEROBRA_JOINT)
|
if (thing->type == MT_BLUEROBRA_JOINT)
|
||||||
P_KillMobj(thing->target, tmthing, tmthing, DMG_NORMAL);
|
P_KillMobj(thing->target, tmthing, tmthing, DMG_NORMAL);
|
||||||
|
|
@ -1394,7 +1394,7 @@ static BlockItReturn_t PIT_CheckThing(mobj_t *thing)
|
||||||
return BMIT_CONTINUE; // dead
|
return BMIT_CONTINUE; // dead
|
||||||
|
|
||||||
if (tmthing->player->invincibilitytimer > 0
|
if (tmthing->player->invincibilitytimer > 0
|
||||||
|| tmthing->player->growshrinktimer > 0)
|
|| K_IsBigger(tmthing, thing) == true)
|
||||||
{
|
{
|
||||||
P_KillMobj(thing, tmthing, tmthing, DMG_NORMAL);
|
P_KillMobj(thing, tmthing, tmthing, DMG_NORMAL);
|
||||||
return BMIT_CONTINUE; // kill
|
return BMIT_CONTINUE; // kill
|
||||||
|
|
@ -1425,7 +1425,7 @@ static BlockItReturn_t PIT_CheckThing(mobj_t *thing)
|
||||||
|
|
||||||
// kill
|
// kill
|
||||||
if (tmthing->player->invincibilitytimer > 0
|
if (tmthing->player->invincibilitytimer > 0
|
||||||
|| tmthing->player->growshrinktimer > 0)
|
|| K_IsBigger(tmthing, thing) == true)
|
||||||
{
|
{
|
||||||
P_KillMobj(thing, tmthing, tmthing, DMG_NORMAL);
|
P_KillMobj(thing, tmthing, tmthing, DMG_NORMAL);
|
||||||
return BMIT_CONTINUE;
|
return BMIT_CONTINUE;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue