From 1ab9ebf1c0413ba021536ffae57a9120079b542b Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Thu, 30 Aug 2018 22:27:18 -0400 Subject: [PATCH] separate var for dashpad cooldown - no longer has weirdness with pw_flashing - can now have an SA1-style effect for it --- src/d_player.h | 1 + src/dehacked.c | 1 + src/k_kart.c | 32 +++++++++++++++++++++----------- src/p_spec.c | 10 +++++----- 4 files changed, 28 insertions(+), 16 deletions(-) diff --git a/src/d_player.h b/src/d_player.h index 9a3ba707..49fa6de8 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -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) diff --git a/src/dehacked.c b/src/dehacked.c index be17998c..2cffc633 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -7679,6 +7679,7 @@ static const char *const KARTSTUFF_LIST[] = { "POGOSPRING", "BRAKESTOP", "WATERSKIP", + "DASHPADCOOLDOWN", "ITEMROULETTE", "ROULETTETYPE", diff --git a/src/k_kart.c b/src/k_kart.c index 1214fb0a..bcdc7dd0 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -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) diff --git a/src/p_spec.c b/src/p_spec.c index 36490918..57f5659a 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -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;