mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-05-04 16:02:48 +00:00
Make explosions cause earthquakes and initiate flashpals
This commit is contained in:
parent
fc789790bb
commit
6c68c95654
4 changed files with 31 additions and 0 deletions
|
|
@ -513,6 +513,7 @@ extern tic_t mapreset;
|
||||||
extern boolean thwompsactive;
|
extern boolean thwompsactive;
|
||||||
extern SINT8 spbplace;
|
extern SINT8 spbplace;
|
||||||
|
|
||||||
|
extern tic_t bombflashtimer; // Used to avoid causing seizures if multiple mines explode close to you :)
|
||||||
extern boolean legitimateexit;
|
extern boolean legitimateexit;
|
||||||
extern boolean comebackshowninfo;
|
extern boolean comebackshowninfo;
|
||||||
extern tic_t curlap, bestlap;
|
extern tic_t curlap, bestlap;
|
||||||
|
|
|
||||||
|
|
@ -288,6 +288,7 @@ boolean thwompsactive; // Thwomps activate on lap 2
|
||||||
SINT8 spbplace; // SPB exists, give the person behind better items
|
SINT8 spbplace; // SPB exists, give the person behind better items
|
||||||
|
|
||||||
// Client-sided, unsynched variables (NEVER use in anything that needs to be synced with other players)
|
// Client-sided, unsynched variables (NEVER use in anything that needs to be synced with other players)
|
||||||
|
tic_t bombflashtimer = 0; // Cooldown before another FlashPal can be intialized by a bomb exploding near a displayplayer. Avoids seizures.
|
||||||
boolean legitimateexit; // Did this client actually finish the match?
|
boolean legitimateexit; // Did this client actually finish the match?
|
||||||
boolean comebackshowninfo; // Have you already seen the "ATTACK OR PROTECT" message?
|
boolean comebackshowninfo; // Have you already seen the "ATTACK OR PROTECT" message?
|
||||||
tic_t curlap; // Current lap time
|
tic_t curlap; // Current lap time
|
||||||
|
|
|
||||||
26
src/k_kart.c
26
src/k_kart.c
|
|
@ -3321,6 +3321,8 @@ void K_SpawnKartExplosion(fixed_t x, fixed_t y, fixed_t z, fixed_t radius, INT32
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define MINEQUAKEDIST 4096
|
||||||
|
|
||||||
// Spawns the purely visual explosion
|
// Spawns the purely visual explosion
|
||||||
void K_SpawnMineExplosion(mobj_t *source, UINT8 color)
|
void K_SpawnMineExplosion(mobj_t *source, UINT8 color)
|
||||||
{
|
{
|
||||||
|
|
@ -3329,6 +3331,28 @@ void K_SpawnMineExplosion(mobj_t *source, UINT8 color)
|
||||||
mobj_t *dust;
|
mobj_t *dust;
|
||||||
mobj_t *truc;
|
mobj_t *truc;
|
||||||
INT32 speed, speed2;
|
INT32 speed, speed2;
|
||||||
|
INT32 pnum;
|
||||||
|
player_t *p;
|
||||||
|
|
||||||
|
// check for potential display players near the source so we can have a sick earthquake / flashpal.
|
||||||
|
for (pnum = 0; pnum < MAXPLAYERS; pnum++)
|
||||||
|
{
|
||||||
|
p = &players[pnum];
|
||||||
|
|
||||||
|
if (!playeringame[pnum] || !P_IsDisplayPlayer(p))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (R_PointToDist2(p->mo->x, p->mo->y, source->x, source->y) < mapobjectscale*MINEQUAKEDIST)
|
||||||
|
{
|
||||||
|
P_StartQuake(55<<FRACBITS, 12);
|
||||||
|
if (!bombflashtimer && P_CheckSight(p->mo, source))
|
||||||
|
{
|
||||||
|
bombflashtimer = TICRATE*5;
|
||||||
|
P_FlashPal(p, 1, 1);
|
||||||
|
}
|
||||||
|
break; // we can break right now because quakes are global to all split players somehow.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
K_MatchGenericExtraFlags(smoldering, source);
|
K_MatchGenericExtraFlags(smoldering, source);
|
||||||
smoldering->tics = TICRATE*3;
|
smoldering->tics = TICRATE*3;
|
||||||
|
|
@ -3399,6 +3423,8 @@ void K_SpawnMineExplosion(mobj_t *source, UINT8 color)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#undef MINEQUAKEDIST
|
||||||
|
|
||||||
static mobj_t *K_SpawnKartMissile(mobj_t *source, mobjtype_t type, angle_t an, INT32 flags2, fixed_t speed)
|
static mobj_t *K_SpawnKartMissile(mobj_t *source, mobjtype_t type, angle_t an, INT32 flags2, fixed_t speed)
|
||||||
{
|
{
|
||||||
mobj_t *th;
|
mobj_t *th;
|
||||||
|
|
|
||||||
|
|
@ -722,6 +722,9 @@ void P_Ticker(boolean run)
|
||||||
K_CalculateBattleWanted();
|
K_CalculateBattleWanted();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (bombflashtimer)
|
||||||
|
bombflashtimer--; // Bomb seizure prevention
|
||||||
|
|
||||||
if (quake.time)
|
if (quake.time)
|
||||||
{
|
{
|
||||||
fixed_t ir = quake.intensity>>1;
|
fixed_t ir = quake.intensity>>1;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue