mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Stumble damagetype
- DMG_STUMBLE in SOC, hardcode
- Has sector type
- UDMF: damagetype = "Stumble"
- Binary: Sector type 9, section 1
- Can be chained even when invincible, unlike Tumble
- Will never instinctively cause hitlag
This commit is contained in:
parent
8a771521c2
commit
ceed74d052
6 changed files with 37 additions and 9 deletions
|
|
@ -6407,6 +6407,7 @@ struct int_const_s const INT_CONST[] = {
|
||||||
{"DMG_STING",DMG_STING},
|
{"DMG_STING",DMG_STING},
|
||||||
{"DMG_KARMA",DMG_KARMA},
|
{"DMG_KARMA",DMG_KARMA},
|
||||||
{"DMG_VOLTAGE",DMG_VOLTAGE},
|
{"DMG_VOLTAGE",DMG_VOLTAGE},
|
||||||
|
{"DMG_STUMBLE",DMG_STUMBLE},
|
||||||
//// Death types
|
//// Death types
|
||||||
{"DMG_INSTAKILL",DMG_INSTAKILL},
|
{"DMG_INSTAKILL",DMG_INSTAKILL},
|
||||||
{"DMG_DEATHPIT",DMG_DEATHPIT},
|
{"DMG_DEATHPIT",DMG_DEATHPIT},
|
||||||
|
|
|
||||||
|
|
@ -2145,7 +2145,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
||||||
|
|
||||||
if (player->invincibilitytimer > 0)
|
if (player->invincibilitytimer > 0)
|
||||||
{
|
{
|
||||||
sfx= sfx_invind;
|
sfx = sfx_invind;
|
||||||
}
|
}
|
||||||
else if (K_IsBigger(target, inflictor) == true)
|
else if (K_IsBigger(target, inflictor) == true)
|
||||||
{
|
{
|
||||||
|
|
@ -2158,7 +2158,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
||||||
invincible = false;
|
invincible = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (invincible)
|
if (invincible && type != DMG_STUMBLE)
|
||||||
{
|
{
|
||||||
const INT32 oldhitlag = target->hitlag;
|
const INT32 oldhitlag = target->hitlag;
|
||||||
|
|
||||||
|
|
@ -2179,18 +2179,24 @@ 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).
|
// Check if we should allow wombo combos (hard hits by default, inverted by the presence of DMG_WOMBO).
|
||||||
boolean allowcombo = (hardhit == !(damagetype & DMG_WOMBO));
|
boolean allowcombo = ((hardhit || (type == DMG_STUMBLE)) == !(damagetype & DMG_WOMBO));
|
||||||
|
|
||||||
// Tumble is a special case.
|
// Tumble/stumble is a special case.
|
||||||
if (type == DMG_TUMBLE)
|
if (type == DMG_TUMBLE)
|
||||||
{
|
{
|
||||||
// don't allow constant combo
|
// don't allow constant combo
|
||||||
if (player->tumbleBounces == 1 && (P_MobjFlip(target)*target->momz > 0))
|
if (player->tumbleBounces == 1 && (P_MobjFlip(target)*target->momz > 0))
|
||||||
allowcombo = false;
|
allowcombo = false;
|
||||||
}
|
}
|
||||||
|
else if (type == DMG_STUMBLE)
|
||||||
|
{
|
||||||
|
// don't allow constant combo
|
||||||
|
if (player->tumbleBounces == TUMBLEBOUNCES-1 && (P_MobjFlip(target)*target->momz > 0))
|
||||||
|
allowcombo = false;
|
||||||
|
}
|
||||||
|
|
||||||
// DMG_EXPLODE excluded from flashtic checks to prevent dodging eggbox/SPB with weak spinout
|
// 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)
|
if ((target->hitlag == 0 || allowcombo == false) && player->flashing > 0 && type != DMG_EXPLODE && type != DMG_STUMBLE)
|
||||||
{
|
{
|
||||||
// Post-hit invincibility
|
// Post-hit invincibility
|
||||||
K_DoInstashield(player);
|
K_DoInstashield(player);
|
||||||
|
|
@ -2200,7 +2206,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
||||||
}
|
}
|
||||||
|
|
||||||
// We successfully damaged them! Give 'em some bumpers!
|
// We successfully damaged them! Give 'em some bumpers!
|
||||||
if (type != DMG_STING)
|
if (type != DMG_STING && type != DMG_STUMBLE)
|
||||||
{
|
{
|
||||||
UINT8 takeBumpers = 1;
|
UINT8 takeBumpers = 1;
|
||||||
|
|
||||||
|
|
@ -2306,6 +2312,10 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
||||||
K_KartPainEnergyFling(player);
|
K_KartPainEnergyFling(player);
|
||||||
ringburst = 0;
|
ringburst = 0;
|
||||||
break;
|
break;
|
||||||
|
case DMG_STUMBLE:
|
||||||
|
K_StumblePlayer(player);
|
||||||
|
ringburst = 0;
|
||||||
|
break;
|
||||||
case DMG_TUMBLE:
|
case DMG_TUMBLE:
|
||||||
K_TumblePlayer(player, inflictor, source);
|
K_TumblePlayer(player, inflictor, source);
|
||||||
ringburst = 10;
|
ringburst = 10;
|
||||||
|
|
@ -2327,7 +2337,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type != DMG_STING)
|
if (type != DMG_STING && type != DMG_STUMBLE)
|
||||||
{
|
{
|
||||||
player->flashing = K_GetKartFlashing(player);
|
player->flashing = K_GetKartFlashing(player);
|
||||||
}
|
}
|
||||||
|
|
@ -2350,8 +2360,11 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
||||||
K_DropHnextList(player, false);
|
K_DropHnextList(player, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
player->instashield = 15;
|
if (type != DMG_STUMBLE)
|
||||||
K_SetHitLagForObjects(target, inflictor, laglength, true);
|
{
|
||||||
|
player->instashield = 15;
|
||||||
|
K_SetHitLagForObjects(target, inflictor, laglength, true);
|
||||||
|
}
|
||||||
|
|
||||||
if (inflictor && !P_MobjWasRemoved(inflictor) && inflictor->type == MT_BANANA)
|
if (inflictor && !P_MobjWasRemoved(inflictor) && inflictor->type == MT_BANANA)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -528,6 +528,7 @@ struct BasicFF_t
|
||||||
#define DMG_STING 0x04
|
#define DMG_STING 0x04
|
||||||
#define DMG_KARMA 0x05 // Karma Bomb explosion -- works like DMG_EXPLODE, but steals half of their bumpers & deletes the rest
|
#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_VOLTAGE 0x06
|
||||||
|
#define DMG_STUMBLE 0x07
|
||||||
//// Death types - cannot be combined with damage types
|
//// Death types - cannot be combined with damage types
|
||||||
#define DMG_INSTAKILL 0x80
|
#define DMG_INSTAKILL 0x80
|
||||||
#define DMG_DEATHPIT 0x81
|
#define DMG_DEATHPIT 0x81
|
||||||
|
|
|
||||||
|
|
@ -1528,6 +1528,8 @@ static void ParseTextmapSectorParameter(UINT32 i, const char *param, const char
|
||||||
sectors[i].damagetype = SD_DEATHPIT;
|
sectors[i].damagetype = SD_DEATHPIT;
|
||||||
if (fastcmp(val, "Instakill"))
|
if (fastcmp(val, "Instakill"))
|
||||||
sectors[i].damagetype = SD_INSTAKILL;
|
sectors[i].damagetype = SD_INSTAKILL;
|
||||||
|
if (fastcmp(val, "Stumble"))
|
||||||
|
sectors[i].damagetype = SD_STUMBLE;
|
||||||
}
|
}
|
||||||
else if (fastcmp(param, "action"))
|
else if (fastcmp(param, "action"))
|
||||||
sectors[i].action = atol(val);
|
sectors[i].action = atol(val);
|
||||||
|
|
@ -2441,6 +2443,9 @@ static void P_WriteTextmap(void)
|
||||||
case SD_INSTAKILL:
|
case SD_INSTAKILL:
|
||||||
fprintf(f, "damagetype = \"Instakill\";\n");
|
fprintf(f, "damagetype = \"Instakill\";\n");
|
||||||
break;
|
break;
|
||||||
|
case SD_STUMBLE:
|
||||||
|
fprintf(f, "damagetype = \"Stumble\";\n");
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -6011,6 +6016,9 @@ static void P_ConvertBinarySectorTypes(void)
|
||||||
case 8: //Instakill
|
case 8: //Instakill
|
||||||
sectors[i].damagetype = SD_INSTAKILL;
|
sectors[i].damagetype = SD_INSTAKILL;
|
||||||
break;
|
break;
|
||||||
|
case 9: // Stumble
|
||||||
|
sectors[i].damagetype = SD_STUMBLE;
|
||||||
|
break;
|
||||||
case 12: //Wall sector
|
case 12: //Wall sector
|
||||||
sectors[i].specialflags |= SSF_NOSTEPUP;
|
sectors[i].specialflags |= SSF_NOSTEPUP;
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -5145,6 +5145,10 @@ static void P_EvaluateDamageType(player_t *player, sector_t *sector, boolean isT
|
||||||
case SD_INSTAKILL:
|
case SD_INSTAKILL:
|
||||||
P_DamageMobj(player->mo, NULL, NULL, 1, DMG_INSTAKILL);
|
P_DamageMobj(player->mo, NULL, NULL, 1, DMG_INSTAKILL);
|
||||||
break;
|
break;
|
||||||
|
case SD_STUMBLE:
|
||||||
|
if (isTouching)
|
||||||
|
P_DamageMobj(player->mo, NULL, NULL, 1, DMG_STUMBLE);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -411,6 +411,7 @@ typedef enum
|
||||||
SD_LAVA = 2,
|
SD_LAVA = 2,
|
||||||
SD_DEATHPIT = 3,
|
SD_DEATHPIT = 3,
|
||||||
SD_INSTAKILL = 4,
|
SD_INSTAKILL = 4,
|
||||||
|
SD_STUMBLE = 5,
|
||||||
} sectordamage_t;
|
} sectordamage_t;
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue