separate var for dashpad cooldown

- no longer has weirdness with pw_flashing
- can now have an SA1-style effect for it
This commit is contained in:
TehRealSalt 2018-08-30 22:27:18 -04:00
parent cdaaca9b62
commit 1ab9ebf1c0
4 changed files with 28 additions and 16 deletions

View file

@ -297,6 +297,7 @@ typedef enum
k_pogospring, // Pogo spring bounce effect
k_brakestop, // Wait until you've made a complete stop for a few tics before letting brake go in reverse.
k_waterskip, // Water skipping counter
k_dashpadcooldown, // Separate the vanilla SA-style dash pads from using pw_flashing
k_itemroulette, // Used for the roulette when deciding what item to give you (was "pw_kartitem")
k_roulettetype, // Used for the roulette, for deciding type (currently only used for Battle, to give you better items from Karma items)

View file

@ -7679,6 +7679,7 @@ static const char *const KARTSTUFF_LIST[] = {
"POGOSPRING",
"BRAKESTOP",
"WATERSKIP",
"DASHPADCOOLDOWN",
"ITEMROULETTE",
"ROULETTETYPE",

View file

@ -3161,16 +3161,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
{
K_UpdateOffroad(player);
// setting players to use the star colormap and spawning afterimages
if (player->kartstuff[k_invincibilitytimer])
{
mobj_t *ghost;
player->mo->colorized = true;
ghost = P_SpawnGhostMobj(player->mo);
ghost->fuse = 4;
ghost->frame |= FF_FULLBRIGHT;
}
else if (player->kartstuff[k_eggmanexplode])
if (player->kartstuff[k_eggmanexplode]) // You're gonna diiiiie
{
const INT32 flashtime = 4<<(player->kartstuff[k_eggmanexplode]/TICRATE);
if (player->kartstuff[k_eggmanexplode] == 1 || (player->kartstuff[k_eggmanexplode] % (flashtime/2) != 0))
@ -3189,7 +3180,15 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
player->mo->color = SKINCOLOR_CRIMSON;
}
}
else if (player->kartstuff[k_growshrinktimer])
else if (player->kartstuff[k_invincibilitytimer]) // setting players to use the star colormap and spawning afterimages
{
mobj_t *ghost;
player->mo->colorized = true;
ghost = P_SpawnGhostMobj(player->mo);
ghost->fuse = 4;
ghost->frame |= FF_FULLBRIGHT;
}
else if (player->kartstuff[k_growshrinktimer]) // Ditto, for grow/shrink
{
if (player->kartstuff[k_growshrinktimer] % 5 == 0)
{
@ -3207,6 +3206,17 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
player->mo->colorized = false;
}
if (player->kartstuff[k_dashpadcooldown]) // Twinkle Circuit inspired afterimages
{
mobj_t *ghost;
ghost = P_SpawnGhostMobj(player->mo);
ghost->fuse = player->kartstuff[k_dashpadcooldown]+1;
ghost->momx = player->mo->momx / (player->kartstuff[k_dashpadcooldown]+1);
ghost->momy = player->mo->momy / (player->kartstuff[k_dashpadcooldown]+1);
ghost->momz = player->mo->momz / (player->kartstuff[k_dashpadcooldown]+1);
player->kartstuff[k_dashpadcooldown]--;
}
if (player->kartstuff[k_spinouttimer])
{
if ((P_IsObjectOnGround(player->mo) || player->kartstuff[k_spinouttype] == 1)

View file

@ -3798,7 +3798,7 @@ DoneSection2:
case 5: // Speed pad w/o spin
case 6: // Speed pad w/ spin
if (player->powers[pw_flashing] != 0 && player->powers[pw_flashing] < TICRATE/2)
if (player->kartstuff[k_dashpadcooldown] != 0)
break;
i = P_FindSpecialLineFromTag(4, sector->tag, -1);
@ -3843,15 +3843,15 @@ DoneSection2:
P_InstaThrust(player->mo, player->mo->angle, linespeed);
if (GETSECSPECIAL(sector->special, 3) == 6 && (player->charability2 == CA2_SPINDASH))
/*if (GETSECSPECIAL(sector->special, 3) == 6 && (player->charability2 == CA2_SPINDASH)) // SRB2kart
{
if (!(player->pflags & PF_SPINNING))
player->pflags |= PF_SPINNING;
//P_SetPlayerMobjState(player->mo, S_PLAY_ATK1); // SRB2kart
}
//P_SetPlayerMobjState(player->mo, S_PLAY_ATK1);
}*/
player->powers[pw_flashing] = TICRATE/3;
player->kartstuff[k_dashpadcooldown] = TICRATE/3;
S_StartSound(player->mo, sfx_spdpad);
}
break;