Merge branch 'hitlag-flags' into 'master'

Hitlag flags

See merge request KartKrew/Kart!541
This commit is contained in:
SteelT 2022-01-23 19:02:43 +00:00
commit dbacdb4e63
9 changed files with 39 additions and 21 deletions

View file

@ -5809,6 +5809,7 @@ const char *const MOBJFLAG_LIST[] = {
"DONTENCOREMAP", "DONTENCOREMAP",
"PICKUPFROMBELOW", "PICKUPFROMBELOW",
"NOSQUISH", "NOSQUISH",
"NOHITLAGFORME",
NULL NULL
}; };
@ -6559,6 +6560,7 @@ struct int_const_s const INT_CONST[] = {
//// Masks //// Masks
{"DMG_STEAL",DMG_CANTHURTSELF}, {"DMG_STEAL",DMG_CANTHURTSELF},
{"DMG_CANTHURTSELF",DMG_CANTHURTSELF}, {"DMG_CANTHURTSELF",DMG_CANTHURTSELF},
{"DMG_WOMBO", DMG_WOMBO},
{"DMG_DEATHMASK",DMG_DEATHMASK}, {"DMG_DEATHMASK",DMG_DEATHMASK},
{"DMG_TYPEMASK",DMG_TYPEMASK}, {"DMG_TYPEMASK",DMG_TYPEMASK},

View file

@ -9295,7 +9295,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
4, // mass 4, // mass
0, // damage 0, // damage
sfx_None, // activesound sfx_None, // activesound
MF_NOBLOCKMAP|MF_SCENERY|MF_NOCLIPHEIGHT, // flags MF_NOBLOCKMAP|MF_SCENERY|MF_NOCLIPHEIGHT|MF_NOHITLAGFORME, // flags
S_NULL // raisestate S_NULL // raisestate
}, },
@ -9322,7 +9322,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
4, // mass 4, // mass
0, // damage 0, // damage
sfx_None, // activesound sfx_None, // activesound
MF_NOBLOCKMAP|MF_NOGRAVITY|MF_SCENERY|MF_NOCLIPHEIGHT|MF_PAPERCOLLISION, // flags MF_NOBLOCKMAP|MF_NOGRAVITY|MF_SCENERY|MF_NOCLIPHEIGHT|MF_PAPERCOLLISION|MF_NOHITLAGFORME, // flags
S_NULL // raisestate S_NULL // raisestate
}, },
@ -9349,7 +9349,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
4, // mass 4, // mass
0, // damage 0, // damage
sfx_None, // activesound sfx_None, // activesound
MF_NOBLOCKMAP|MF_NOGRAVITY|MF_NOCLIP|MF_NOCLIPTHING, // flags MF_NOBLOCKMAP|MF_NOGRAVITY|MF_NOCLIP|MF_NOCLIPTHING|MF_NOHITLAGFORME, // flags
S_NULL // raisestate S_NULL // raisestate
}, },

View file

@ -48,7 +48,7 @@ boolean K_OrbinautJawzCollide(mobj_t *t1, mobj_t *t2)
else else
{ {
// Player Damage // Player Damage
P_DamageMobj(t2, t1, t1->target, 1, DMG_WIPEOUT); P_DamageMobj(t2, t1, t1->target, 1, DMG_WIPEOUT|DMG_WOMBO);
K_KartBouncing(t2, t1); K_KartBouncing(t2, t1);
S_StartSound(t2, sfx_s3k7b); S_StartSound(t2, sfx_s3k7b);
} }
@ -143,7 +143,7 @@ boolean K_BananaBallhogCollide(mobj_t *t1, mobj_t *t2)
} }
else else
{ {
P_DamageMobj(t2, t1, t1->target, 1, DMG_NORMAL); P_DamageMobj(t2, t1, t1->target, 1, DMG_NORMAL|DMG_WOMBO);
} }
damageitem = true; damageitem = true;
@ -492,12 +492,12 @@ boolean K_PvPTouchDamage(mobj_t *t1, mobj_t *t2)
if (t1Condition == true && t2Condition == false) if (t1Condition == true && t2Condition == false)
{ {
P_DamageMobj(t2, t1, t1, 1, DMG_TUMBLE); P_DamageMobj(t2, t1, t1, 1, DMG_TUMBLE|DMG_WOMBO);
return true; return true;
} }
else if (t1Condition == false && t2Condition == true) else if (t1Condition == false && t2Condition == true)
{ {
P_DamageMobj(t1, t2, t2, 1, DMG_TUMBLE); P_DamageMobj(t1, t2, t2, 1, DMG_TUMBLE|DMG_WOMBO);
return true; return true;
} }
@ -507,12 +507,12 @@ boolean K_PvPTouchDamage(mobj_t *t1, mobj_t *t2)
if (t1Condition == true && t2Condition == false) if (t1Condition == true && t2Condition == false)
{ {
P_DamageMobj(t2, t1, t1, 1, DMG_TUMBLE); P_DamageMobj(t2, t1, t1, 1, DMG_TUMBLE|DMG_WOMBO);
return true; return true;
} }
else if (t1Condition == false && t2Condition == true) else if (t1Condition == false && t2Condition == true)
{ {
P_DamageMobj(t1, t2, t2, 1, DMG_TUMBLE); P_DamageMobj(t1, t2, t2, 1, DMG_TUMBLE|DMG_WOMBO);
return true; return true;
} }
@ -522,12 +522,12 @@ boolean K_PvPTouchDamage(mobj_t *t1, mobj_t *t2)
if (t1Condition == true && t2Condition == false) if (t1Condition == true && t2Condition == false)
{ {
P_DamageMobj(t2, t1, t1, 1, DMG_WIPEOUT); P_DamageMobj(t2, t1, t1, 1, DMG_WIPEOUT|DMG_WOMBO);
return true; return true;
} }
else if (t1Condition == false && t2Condition == true) else if (t1Condition == false && t2Condition == true)
{ {
P_DamageMobj(t1, t2, t2, 1, DMG_WIPEOUT); P_DamageMobj(t1, t2, t2, 1, DMG_WIPEOUT|DMG_WOMBO);
return true; return true;
} }
@ -540,12 +540,12 @@ boolean K_PvPTouchDamage(mobj_t *t1, mobj_t *t2)
if (t1Condition == true && t2Condition == false) if (t1Condition == true && t2Condition == false)
{ {
P_DamageMobj(t2, t1, t1, 1, DMG_WIPEOUT|DMG_STEAL); P_DamageMobj(t2, t1, t1, 1, DMG_WIPEOUT|DMG_STEAL|DMG_WOMBO);
return true; return true;
} }
else if (t1Condition == false && t2Condition == true) else if (t1Condition == false && t2Condition == true)
{ {
P_DamageMobj(t1, t2, t2, 1, DMG_WIPEOUT|DMG_STEAL); P_DamageMobj(t1, t2, t2, 1, DMG_WIPEOUT|DMG_STEAL|DMG_WOMBO);
return true; return true;
} }
} }
@ -558,7 +558,7 @@ boolean K_PvPTouchDamage(mobj_t *t1, mobj_t *t2)
{ {
if (t2->player->rings <= 0) if (t2->player->rings <= 0)
{ {
P_DamageMobj(t2, t1, t1, 1, DMG_STING); P_DamageMobj(t2, t1, t1, 1, DMG_STING|DMG_WOMBO);
stungT2 = true; stungT2 = true;
} }
@ -569,7 +569,7 @@ boolean K_PvPTouchDamage(mobj_t *t1, mobj_t *t2)
{ {
if (t1->player->rings <= 0) if (t1->player->rings <= 0)
{ {
P_DamageMobj(t1, t2, t2, 1, DMG_STING); P_DamageMobj(t1, t2, t2, 1, DMG_STING|DMG_WOMBO);
stungT1 = true; stungT1 = true;
} }

View file

@ -3151,7 +3151,7 @@ angle_t K_MomentumAngle(mobj_t *mo)
void K_AddHitLag(mobj_t *mo, INT32 tics, boolean fromDamage) void K_AddHitLag(mobj_t *mo, INT32 tics, boolean fromDamage)
{ {
if (mo == NULL || P_MobjWasRemoved(mo)) if (mo == NULL || P_MobjWasRemoved(mo) || (mo->flags & MF_NOHITLAGFORME && mo->type != MT_PLAYER))
{ {
return; return;
} }

View file

@ -1929,7 +1929,18 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
if (combo == false) if (combo == false)
{ {
if (player->mo->hitlag == 0 && player->flashing > 0) // Check if we should allow wombo combos (DMG_WOMBO)
boolean allowcombo = false;
// For MISSILE OBJECTS, allow combo BY DEFAULT. If DMG_WOMBO is set, do *NOT* allow it.
if (inflictor && !P_MobjWasRemoved(inflictor) && (inflictor->flags & MF_MISSILE) && !(damagetype & DMG_WOMBO))
allowcombo = true;
// OTHERWISE, only allow combos IF DMG_WOMBO *IS* set.
else if (damagetype & DMG_WOMBO)
allowcombo = true;
if ((player->mo->hitlag == 0 || allowcombo == false) && player->flashing > 0)
{ {
// Post-hit invincibility // Post-hit invincibility
K_DoInstashield(player); K_DoInstashield(player);

View file

@ -486,6 +486,7 @@ typedef struct BasicFF_s
#define DMG_SPECTATOR 0x83 #define DMG_SPECTATOR 0x83
#define DMG_TIMEOVER 0x84 #define DMG_TIMEOVER 0x84
// Masks // Masks
#define DMG_WOMBO 0x10 // Flag - setting this flag allows objects to damage you if you're already in spinout. The effect is reversed on objects with MF_MISSILE (setting it prevents them from comboing in spinout)
#define DMG_STEAL 0x20 // Flag - can steal bumpers, will only deal damage to players, and will not deal damage outside Battle Mode. #define DMG_STEAL 0x20 // Flag - can steal bumpers, will only deal damage to players, and will not deal damage outside Battle Mode.
#define DMG_CANTHURTSELF 0x40 // Flag - cannot hurt your self or your team #define DMG_CANTHURTSELF 0x40 // Flag - cannot hurt your self or your team
#define DMG_DEATHMASK DMG_INSTAKILL // if bit 7 is set, this is a death type instead of a damage type #define DMG_DEATHMASK DMG_INSTAKILL // if bit 7 is set, this is a death type instead of a damage type

View file

@ -782,7 +782,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
return true; return true;
// Player Damage // Player Damage
P_DamageMobj(tmthing, ((thing->type == MT_BUBBLESHIELD) ? thing->target : thing), thing, 1, DMG_NORMAL); P_DamageMobj(tmthing, ((thing->type == MT_BUBBLESHIELD) ? thing->target : thing), thing, 1, DMG_NORMAL|DMG_WOMBO);
S_StartSound(thing, sfx_s3k44); S_StartSound(thing, sfx_s3k44);
} }
else else

View file

@ -161,7 +161,9 @@ typedef enum
MF_PICKUPFROMBELOW = 1<<29, MF_PICKUPFROMBELOW = 1<<29,
// Disable momentum-based squash and stretch. // Disable momentum-based squash and stretch.
MF_NOSQUISH = 1<<30, MF_NOSQUISH = 1<<30,
// free: to and including 1<<31 // Disable hitlag for this object
MF_NOHITLAGFORME = 1<<31,
// no more free slots, next up I suppose we can get rid of shit like MF_BOXICON?
} mobjflag_t; } mobjflag_t;
typedef enum typedef enum

View file

@ -2464,8 +2464,10 @@ void P_NukeEnemies(mobj_t *inflictor, mobj_t *source, fixed_t radius)
indirectitemcooldown = 0; indirectitemcooldown = 0;
} }
if (mo->flags & MF_BOSS || mo->type == MT_PLAYER) //don't OHKO bosses nor players! if (mo->flags & MF_BOSS) //don't OHKO bosses nor players!
P_DamageMobj(mo, inflictor, source, 1, DMG_NORMAL|DMG_CANTHURTSELF); P_DamageMobj(mo, inflictor, source, 1, DMG_NORMAL|DMG_CANTHURTSELF);
else if (mo->type == MT_PLAYER) // Thunder shield: Combo players.
P_DamageMobj(mo, inflictor, source, 1, DMG_NORMAL|DMG_CANTHURTSELF|DMG_WOMBO);
else else
P_DamageMobj(mo, inflictor, source, 1000, DMG_NORMAL|DMG_CANTHURTSELF); P_DamageMobj(mo, inflictor, source, 1000, DMG_NORMAL|DMG_CANTHURTSELF);
} }