mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
New pogospring behavior
Spawns a spring under you. First bounce gives you trick air time, subsequent bounces give you tumble.
This commit is contained in:
parent
fda4679aa8
commit
4fb0dfa9c0
5 changed files with 39 additions and 9 deletions
|
|
@ -2544,6 +2544,7 @@ const char *const STATE_LIST[] = { // array length left dynamic for sanity testi
|
|||
// Orange Spring (Pogo)
|
||||
"S_POGOSPRING1",
|
||||
"S_POGOSPRING2",
|
||||
"S_POGOSPRING2B",
|
||||
"S_POGOSPRING3",
|
||||
"S_POGOSPRING4",
|
||||
|
||||
|
|
|
|||
|
|
@ -3075,6 +3075,7 @@ state_t states[NUMSTATES] =
|
|||
// Orange Spring (Pogo)
|
||||
{SPR_SPVB, 0, -1, {NULL}, 0, 0, S_NULL}, // S_POGOSPRING1
|
||||
{SPR_SPVB, 1, 1, {A_Pain}, 0, 0, S_POGOSPRING3}, // S_POGOSPRING2
|
||||
{SPR_SPVB, 1, 1, {A_PlaySeeSound}, 0, 0, S_POGOSPRING3}, // S_POGOSPRING2B
|
||||
{SPR_SPVB, 0, 1, {NULL}, 0, 0, S_POGOSPRING4}, // S_POGOSPRING3
|
||||
{SPR_SPVB, 2, 4, {NULL}, 0, 0, S_POGOSPRING1}, // S_POGOSPRING4
|
||||
|
||||
|
|
@ -8246,9 +8247,9 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
-1, // doomednum
|
||||
S_POGOSPRING1, // spawnstate
|
||||
1000, // spawnhealth
|
||||
S_POGOSPRING2, // seestate
|
||||
sfx_None, // seesound
|
||||
8, // reactiontime
|
||||
S_POGOSPRING2B, // seestate
|
||||
sfx_eggspr, // seesound
|
||||
0, // reactiontime
|
||||
sfx_None, // attacksound
|
||||
S_NULL, // painstate
|
||||
SKINCOLOR_SUNSLAM, // painchance
|
||||
|
|
|
|||
|
|
@ -3532,6 +3532,7 @@ typedef enum state
|
|||
// Orange Spring (Pogo)
|
||||
S_POGOSPRING1,
|
||||
S_POGOSPRING2,
|
||||
S_POGOSPRING2B,
|
||||
S_POGOSPRING3,
|
||||
S_POGOSPRING4,
|
||||
|
||||
|
|
|
|||
|
|
@ -402,7 +402,7 @@ static INT32 K_KartItemOddsBattle[NUMKARTRESULTS][2] =
|
|||
/*Bubble Shield*/ { 1, 0 }, // Bubble Shield
|
||||
/*Flame Shield*/ { 1, 0 }, // Flame Shield
|
||||
/*Hyudoro*/ { 2, 0 }, // Hyudoro
|
||||
/*Pogo Spring*/ { 0, 0 }, // Pogo Spring
|
||||
/*Pogo Spring*/ { 1, 0 }, // Pogo Spring
|
||||
/*Super Ring*/ { 0, 0 }, // Super Ring
|
||||
/*Kitchen Sink*/ { 0, 0 }, // Kitchen Sink
|
||||
/*Drop Target*/ { 2, 0 }, // Drop Target
|
||||
|
|
@ -10124,9 +10124,8 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
|
|||
if (ATTACK_IS_DOWN && !HOLDING_ITEM && onground && NO_HYUDORO && player->trickpanel == 0)
|
||||
{
|
||||
K_PlayBoostTaunt(player->mo);
|
||||
K_DoPogoSpring(player->mo, 32<<FRACBITS, 2);
|
||||
player->trickpanel = 1;
|
||||
player->pflags |= PF_TRICKDELAY;
|
||||
//K_DoPogoSpring(player->mo, 32<<FRACBITS, 2);
|
||||
P_SpawnMobjFromMobj(player->mo, 0, 0, 0, MT_POGOSPRING);
|
||||
player->itemamount--;
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
32
src/p_map.c
32
src/p_map.c
|
|
@ -301,6 +301,7 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object)
|
|||
UINT16 starcolor = (spring->info->painchance % numskincolors);
|
||||
fixed_t savemomx = 0;
|
||||
fixed_t savemomy = 0;
|
||||
statenum_t raisestate = spring->info->raisestate;
|
||||
|
||||
// Object was already sprung this tic
|
||||
if (object->eflags & MFE_SPRUNG)
|
||||
|
|
@ -412,8 +413,6 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object)
|
|||
// Re-solidify
|
||||
spring->flags |= (spring->info->flags & (MF_SPRING|MF_SPECIAL));
|
||||
|
||||
P_SetMobjState(spring, spring->info->raisestate);
|
||||
|
||||
if (object->player)
|
||||
{
|
||||
if (spring->flags & MF_ENEMY) // Spring shells
|
||||
|
|
@ -444,8 +443,37 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object)
|
|||
{
|
||||
object->player->tiregrease = greasetics;
|
||||
}
|
||||
|
||||
if (spring->type == MT_POGOSPRING)
|
||||
{
|
||||
if (spring->reactiontime == 0)
|
||||
{
|
||||
object->player->tricktime = 0; // Reset post-hitlag timer
|
||||
// Setup the boost for potential upwards trick, at worse, make it your regular max speed. (boost = curr speed*1.25)
|
||||
object->player->trickboostpower = max(FixedDiv(object->player->speed, K_GetKartSpeed(object->player, false, false)) - FRACUNIT, 0)*125/100;
|
||||
//CONS_Printf("Got boost: %d%\n", mo->player->trickboostpower*100 / FRACUNIT);
|
||||
object->player->trickpanel = 1;
|
||||
object->player->pflags |= PF_TRICKDELAY;
|
||||
}
|
||||
else
|
||||
{
|
||||
raisestate = spring->info->seestate;
|
||||
|
||||
object->player->tumbleBounces = 1;
|
||||
object->player->pflags &= ~PF_TUMBLESOUND;
|
||||
object->player->tumbleHeight = 50;
|
||||
P_SetPlayerMobjState(object->player->mo, S_KART_SPINOUT);
|
||||
|
||||
// FIXME: try to compensate tumbling gravity
|
||||
object->momz = 3 * object->momz / 2;
|
||||
}
|
||||
|
||||
spring->reactiontime++;
|
||||
}
|
||||
}
|
||||
|
||||
P_SetMobjState(spring, raisestate);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue