Merge branch 'sonicitems' into encore

This commit is contained in:
toaster 2018-08-11 22:52:24 +01:00
commit 000fbe8b52
9 changed files with 31 additions and 31 deletions

View file

@ -2479,7 +2479,7 @@ void G_PlayerReborn(INT32 player)
p->panim = PA_IDLE; // standing animation
if ((netgame || multiplayer) && !p->spectator)
p->powers[pw_flashing] = K_GetKartFlashing()-1; // Babysitting deterrent
p->powers[pw_flashing] = K_GetKartFlashing(p)-1; // Babysitting deterrent
if (p-players == consoleplayer)
{

View file

@ -1546,14 +1546,12 @@ fixed_t K_GetKartAccel(player_t *player)
return FixedMul(k_accel, K_GetKartBoostPower(player, false));
}
UINT16 K_GetKartFlashing(void)
UINT16 K_GetKartFlashing(player_t *player)
{
UINT16 tics = flashingtics;
if (G_BattleGametype())
{
tics *= 2;
//tics += (3*TICRATE/8) * (player->kartspeed-1);
}
flashingtics += (flashingtics/6) * (player->kartspeed-5); // when weight is buffed in battle, use this instead: (player->kartspeed - player->kartweight)
return tics;
}
@ -1697,7 +1695,7 @@ void K_SpinPlayer(player_t *player, mobj_t *source, INT32 type, boolean trapitem
else
player->kartstuff[k_spinouttimer] = TICRATE+20; // Wipeout
player->powers[pw_flashing] = K_GetKartFlashing();
player->powers[pw_flashing] = K_GetKartFlashing(player);
if (player->mo->state != &states[S_KART_SPIN])
P_SetPlayerMobjState(player->mo, S_KART_SPIN);
@ -1762,7 +1760,7 @@ void K_SquishPlayer(player_t *player, mobj_t *source)
player->kartstuff[k_squishedtimer] = 2*TICRATE;
player->powers[pw_flashing] = K_GetKartFlashing();
player->powers[pw_flashing] = K_GetKartFlashing(player);
player->mo->flags |= MF_NOCLIP;
@ -1835,7 +1833,7 @@ void K_ExplodePlayer(player_t *player, mobj_t *source) // A bit of a hack, we ju
player->kartstuff[k_spinouttype] = 1;
player->kartstuff[k_spinouttimer] = 2*TICRATE+(TICRATE/2);
player->powers[pw_flashing] = K_GetKartFlashing();
player->powers[pw_flashing] = K_GetKartFlashing(player);
if (player->mo->state != &states[S_KART_SPIN])
P_SetPlayerMobjState(player->mo, S_KART_SPIN);
@ -1917,10 +1915,10 @@ void K_StealBumper(player_t *player, player_t *victim, boolean force)
player->kartstuff[k_bumper]++;
player->kartstuff[k_comebackpoints] = 0;
player->powers[pw_flashing] = K_GetKartFlashing();
player->powers[pw_flashing] = K_GetKartFlashing(player);
player->kartstuff[k_comebacktimer] = comebacktime;
/*victim->powers[pw_flashing] = K_GetKartFlashing();
/*victim->powers[pw_flashing] = K_GetKartFlashing(victim);
victim->kartstuff[k_comebacktimer] = comebacktime;*/
victim->kartstuff[k_instashield] = 15;
@ -3051,7 +3049,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
}
}
if (player->kartstuff[k_spinouttimer] == 0 && player->powers[pw_flashing] == K_GetKartFlashing())
if (player->kartstuff[k_spinouttimer] == 0 && player->powers[pw_flashing] == K_GetKartFlashing(player))
player->powers[pw_flashing]--;
/*if (player->kartstuff[k_thunderanim])

View file

@ -47,7 +47,7 @@ void K_StripItems(player_t *player);
void K_MomentumToFacing(player_t *player);
fixed_t K_GetKartSpeed(player_t *player, boolean doboostpower);
fixed_t K_GetKartAccel(player_t *player);
UINT16 K_GetKartFlashing(void);
UINT16 K_GetKartFlashing(player_t *player);
fixed_t K_3dKartMovement(player_t *player, boolean onground, fixed_t forwardmove);
void K_MoveKartPlayer(player_t *player, boolean onground);
void K_CalculateBattleWanted(void);

View file

@ -2298,11 +2298,11 @@ static int lib_kGetKartAccel(lua_State *L)
static int lib_kGetKartFlashing(lua_State *L)
{
//player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
//HUDSAFE
//if (!player)
//return LUA_ErrInvalid(L, "player_t");
lua_pushinteger(L, K_GetKartFlashing());
if (!player)
return LUA_ErrInvalid(L, "player_t");
lua_pushinteger(L, K_GetKartFlashing(player));
return 0;
}

View file

@ -1368,7 +1368,7 @@ void Command_ObjectPlace_f(void)
players[0].mo->color = op_oldcolor;
// This is necessary for recovery of dying players.
if (players[0].powers[pw_flashing] >= K_GetKartFlashing())
players[0].powers[pw_flashing] = K_GetKartFlashing() - 1;
if (players[0].powers[pw_flashing] >= K_GetKartFlashing(&players[0]))
players[0].powers[pw_flashing] = K_GetKartFlashing(&players[0]) - 1;
}
}

View file

@ -2694,7 +2694,7 @@ static inline void P_NiGHTSDamage(mobj_t *target, mobj_t *source)
target->momy = FixedMul(FINESINE(fa),target->target->radius);
}
player->powers[pw_flashing] = K_GetKartFlashing();
player->powers[pw_flashing] = K_GetKartFlashing(player);
P_SetMobjState(target->tracer, S_NIGHTSHURT1);
S_StartSound(target, sfx_nghurt);
@ -3437,7 +3437,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
player->health -= damage; // mirror mobj health here
if (damage < 10000)
{
target->player->powers[pw_flashing] = K_GetKartFlashing();
target->player->powers[pw_flashing] = K_GetKartFlashing(target->player);
if (damage > 0) // don't spill emeralds/ammo/panels for shield damage
P_PlayerRingBurst(player, damage);
}

View file

@ -217,10 +217,10 @@ boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state)
}
}
// You were in pain state after taking a hit, and you're moving out of pain state now?
else */if (mobj->state == &states[mobj->info->painstate] && player->powers[pw_flashing] == K_GetKartFlashing() && state != mobj->info->painstate)
else */if (mobj->state == &states[mobj->info->painstate] && player->powers[pw_flashing] == K_GetKartFlashing(player) && state != mobj->info->painstate)
{
// Start flashing, since you've landed.
player->powers[pw_flashing] = K_GetKartFlashing()-1;
player->powers[pw_flashing] = K_GetKartFlashing(player)-1;
//P_DoPityCheck(player);
}

View file

@ -7629,7 +7629,9 @@ void T_Pusher(pusher_t *p)
if (thing->player && thing->player->pflags & PF_ROPEHANG)
continue;
if (thing->player && (thing->state == &states[thing->info->painstate]) && (thing->player->powers[pw_flashing] > (K_GetKartFlashing()/4)*3 && thing->player->powers[pw_flashing] <= K_GetKartFlashing()))
if (thing->player && (thing->state == &states[thing->info->painstate])
&& (thing->player->powers[pw_flashing] > (K_GetKartFlashing(thing->player)/4)*3
&& thing->player->powers[pw_flashing] <= K_GetKartFlashing(thing->player)))
continue;
inFOF = touching = moved = false;

View file

@ -919,7 +919,7 @@ void P_DoPlayerPain(player_t *player, mobj_t *source, mobj_t *inflictor)
P_ResetPlayer(player);
P_SetPlayerMobjState(player->mo, player->mo->info->painstate);
player->powers[pw_flashing] = K_GetKartFlashing();
player->powers[pw_flashing] = K_GetKartFlashing(player);
if (player->timeshit != UINT8_MAX)
++player->timeshit;
@ -5804,7 +5804,7 @@ static void P_NiGHTSMovement(player_t *player)
}
// Currently reeling from being hit.
if (player->powers[pw_flashing] > (2*K_GetKartFlashing())/3)
if (player->powers[pw_flashing] > (2*K_GetKartFlashing(player))/3)
{
{
const angle_t fa = (FixedAngle(player->flyangle*FRACUNIT)>>ANGLETOFINESHIFT) & FINEMASK;
@ -9506,7 +9506,7 @@ void P_PlayerThink(player_t *player)
player->powers[pw_invulnerability]--;
if (player->powers[pw_flashing] && player->powers[pw_flashing] < UINT16_MAX && ((player->pflags & PF_NIGHTSMODE)
|| (player->spectator || player->powers[pw_flashing] < K_GetKartFlashing())))
|| (player->spectator || player->powers[pw_flashing] < K_GetKartFlashing(player))))
player->powers[pw_flashing]--;
if (player->powers[pw_tailsfly] && player->powers[pw_tailsfly] < UINT16_MAX && player->charability != CA_SWIM && !(player->powers[pw_super] && ALL7EMERALDS(player->powers[pw_emeralds]))) // tails fly counter
@ -9602,7 +9602,7 @@ void P_PlayerThink(player_t *player)
|| (G_BattleGametype() && player->kartstuff[k_bumper] <= 0 && player->kartstuff[k_comebacktimer])
|| leveltime < starttime)) // Level intro
{
if (player->powers[pw_flashing] > 0 && player->powers[pw_flashing] < K_GetKartFlashing()
if (player->powers[pw_flashing] > 0 && player->powers[pw_flashing] < K_GetKartFlashing(player)
&& (leveltime & 1))
player->mo->flags2 |= MF2_DONTDRAW;
else