mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-12-31 04:02:37 +00:00
Improve burning rings from payout
This commit is contained in:
parent
046564eece
commit
975b2cce98
8 changed files with 36 additions and 9 deletions
|
|
@ -843,6 +843,7 @@ struct player_t
|
|||
UINT8 pickuprings; // Number of rings being picked up before added to the counter (prevents rings from being deleted forever over 20)
|
||||
UINT8 ringdelay; // (0 to 3) - 3 tic delay between every ring usage
|
||||
UINT16 ringboost; // Ring boost timer
|
||||
UINT16 momentboost; // Sigh
|
||||
UINT8 sparkleanim; // (0 to 19) - Angle offset for ring sparkle animation
|
||||
UINT16 superring; // You were awarded rings, and have this many of them left to spawn on yourself.
|
||||
UINT16 superringdisplay; // For HUD countup when awarded superring
|
||||
|
|
@ -1129,7 +1130,7 @@ struct player_t
|
|||
boolean dotrickfx;
|
||||
boolean stingfx;
|
||||
UINT8 bumperinflate;
|
||||
|
||||
|
||||
boolean mfdfinish; // Did you cross the finish line while just about to explode?
|
||||
|
||||
UINT8 ringboxdelay; // Delay until Ring Box auto-activates
|
||||
|
|
|
|||
|
|
@ -184,7 +184,7 @@ demoghost *ghosts = NULL;
|
|||
// - 0x0011 -- RR 2.4 rc2 (K_FlipFromObject oversight)
|
||||
|
||||
#define MINDEMOVERSION 0x000E
|
||||
#define DEMOVERSION 0x0011
|
||||
#define DEMOVERSION 0x0012
|
||||
|
||||
boolean G_CompatLevel(UINT16 level)
|
||||
{
|
||||
|
|
|
|||
19
src/k_kart.c
19
src/k_kart.c
|
|
@ -3904,6 +3904,11 @@ static void K_GetKartBoostPower(player_t *player)
|
|||
); // + 20% + ???% top speed, + 400% acceleration, +???% handling
|
||||
}
|
||||
|
||||
if (player->momentboost)
|
||||
{
|
||||
ADDBOOST(FRACUNIT/3, FRACUNIT/3, 0);
|
||||
}
|
||||
|
||||
if (player->eggmanexplode) // Ready-to-explode
|
||||
{
|
||||
ADDBOOST(6*FRACUNIT/20, FRACUNIT, 0); // + 30% top speed, + 100% acceleration, +0% handling
|
||||
|
|
@ -10544,6 +10549,9 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
|
|||
// CONS_Printf("%d - %d\n", player->ringboost, oldringboost - player->ringboost);
|
||||
}
|
||||
|
||||
if (player->momentboost)
|
||||
player->momentboost--;
|
||||
|
||||
if (!G_CompatLevel(0x0010) && player->superring == 0 && player->ringboxdelay == 0 && player->ringboost < player->lastringboost)
|
||||
{
|
||||
player->lastringboost = player->ringboost;
|
||||
|
|
@ -10798,7 +10806,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
|
|||
|
||||
if ((player->baildrop % BAIL_DROPFREQUENCY) == 0)
|
||||
{
|
||||
P_FlingBurst(player, K_MomentumAngle(pmo), MT_FLINGRING, 10*TICRATE, FRACUNIT, player->baildrop/BAIL_DROPFREQUENCY);
|
||||
P_FlingBurst(player, K_MomentumAngle(pmo), MT_FLINGRING, 10*TICRATE, FRACUNIT, player->baildrop/BAIL_DROPFREQUENCY, FRACUNIT);
|
||||
S_StartSound(pmo, sfx_gshad);
|
||||
}
|
||||
|
||||
|
|
@ -15066,6 +15074,15 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
|
|||
{
|
||||
player->superring--;
|
||||
dumprate = 2;
|
||||
|
||||
if (ring && !P_MobjWasRemoved(ring))
|
||||
{
|
||||
ring->extravalue2 = 1;
|
||||
}
|
||||
|
||||
// angle_t flingangle = player->mo->angle + ((P_RandomByte(PR_ITEM_RINGS) & 1) ? -ANGLE_90 : ANGLE_90);
|
||||
// P_FlingBurst(player, flingangle, MT_DEBTSPIKE, 0, 3 * FRACUNIT / 2, player->superring, 4*FRACUNIT);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -465,6 +465,8 @@ static int player_get(lua_State *L)
|
|||
lua_pushinteger(L, plr->ringdelay);
|
||||
else if (fastcmp(field,"ringboost"))
|
||||
lua_pushinteger(L, plr->ringboost);
|
||||
else if (fastcmp(field,"momentboost"))
|
||||
lua_pushinteger(L, plr->momentboost);
|
||||
else if (fastcmp(field,"sparkleanim"))
|
||||
lua_pushinteger(L, plr->sparkleanim);
|
||||
else if (fastcmp(field,"superring"))
|
||||
|
|
@ -1049,7 +1051,7 @@ static int player_set(lua_State *L)
|
|||
else if (fastcmp(field,"fakeboost"))
|
||||
plr->fakeBoost = luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"subsonicleniency"))
|
||||
plr->subsonicleniency = luaL_checkinteger(L, 3);
|
||||
plr->subsonicleniency = luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"tripwireleniency"))
|
||||
plr->tripwireLeniency = luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"tripwireairleniency"))
|
||||
|
|
|
|||
|
|
@ -3550,6 +3550,9 @@ void A_AttractChase(mobj_t *actor)
|
|||
// Base add is 3 tics for 9,9, adds 1 tic for each point closer to the 1,1 end
|
||||
actor->target->player->ringboost += K_GetFullKartRingPower(actor->target->player, true);
|
||||
|
||||
if (actor->extravalue2 && !G_CompatLevel(0x0011))
|
||||
actor->target->player->momentboost += 3;
|
||||
|
||||
S_ReducedVFXSoundAtVolume(actor->target, sfx_s1b5, actor->target->player->ringvolume, NULL);
|
||||
|
||||
if (actor->target->player->rings <= 10 && P_IsDisplayPlayer(actor->target->player))
|
||||
|
|
|
|||
|
|
@ -4523,7 +4523,8 @@ void P_FlingBurst
|
|||
mobjtype_t objType,
|
||||
tic_t objFuse,
|
||||
fixed_t objScale,
|
||||
INT32 i)
|
||||
INT32 i,
|
||||
fixed_t dampen)
|
||||
{
|
||||
mobj_t *mo = P_SpawnMobjFromMobj(player->mo, 0, 0, 0, objType);
|
||||
P_SetTarget(&mo->target, player->mo);
|
||||
|
|
@ -4550,7 +4551,8 @@ void P_FlingBurst
|
|||
angle_t fp = offset + (((i / 2) % RING_LAYER_SIDE_SIZE) * (offset * 3 >> 1));
|
||||
|
||||
const UINT8 layer = i / RING_LAYER_SIZE;
|
||||
const fixed_t thrust = (13 * mo->scale) + (7 * mo->scale * layer);
|
||||
fixed_t thrust = (13 * mo->scale) + (7 * mo->scale * layer);
|
||||
thrust = FixedDiv(thrust, dampen);
|
||||
mo->momx = (player->mo->momx / 2) + FixedMul(FixedMul(thrust, FINECOSINE(fp >> ANGLETOFINESHIFT)), FINECOSINE(fa >> ANGLETOFINESHIFT));
|
||||
mo->momy = (player->mo->momy / 2) + FixedMul(FixedMul(thrust, FINECOSINE(fp >> ANGLETOFINESHIFT)), FINESINE(fa >> ANGLETOFINESHIFT));
|
||||
mo->momz = (player->mo->momz / 2) + (FixedMul(thrust, FINESINE(fp >> ANGLETOFINESHIFT)) * P_MobjFlip(mo));
|
||||
|
|
@ -4595,12 +4597,12 @@ void P_PlayerRingBurst(player_t *player, INT32 num_rings)
|
|||
|
||||
for (i = 0; i < num_fling_rings; i++)
|
||||
{
|
||||
P_FlingBurst(player, fa, MT_FLINGRING, 60*TICRATE, FRACUNIT, i);
|
||||
P_FlingBurst(player, fa, MT_FLINGRING, 60*TICRATE, FRACUNIT, i, FRACUNIT);
|
||||
}
|
||||
|
||||
while (i < spill_total)
|
||||
{
|
||||
P_FlingBurst(player, fa, MT_DEBTSPIKE, 0, 3 * FRACUNIT / 2, i++);
|
||||
P_FlingBurst(player, fa, MT_DEBTSPIKE, 0, 3 * FRACUNIT / 2, i++, FRACUNIT);
|
||||
}
|
||||
|
||||
K_DefensiveOverdrive(player);
|
||||
|
|
|
|||
|
|
@ -555,7 +555,7 @@ void P_SpecialStageDamage(player_t *player, mobj_t *inflictor, mobj_t *source);
|
|||
boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 damage, UINT8 damagetype);
|
||||
void P_UpdateRemovedOrbital(mobj_t *target, mobj_t *inflictor, mobj_t *source);
|
||||
void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damagetype);
|
||||
void P_FlingBurst(player_t *player, angle_t fa, mobjtype_t objType, tic_t objFuse, fixed_t objScale, INT32 i);
|
||||
void P_FlingBurst(player_t *player, angle_t fa, mobjtype_t objType, tic_t objFuse, fixed_t objScale, INT32 i, fixed_t dampen);
|
||||
void P_PlayerRingBurst(player_t *player, INT32 num_rings); /// \todo better fit in p_user.c
|
||||
|
||||
void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck);
|
||||
|
|
|
|||
|
|
@ -549,6 +549,7 @@ static void P_NetArchivePlayers(savebuffer_t *save)
|
|||
WRITEUINT8(save->p, players[i].pickuprings);
|
||||
WRITEUINT8(save->p, players[i].ringdelay);
|
||||
WRITEUINT16(save->p, players[i].ringboost);
|
||||
WRITEUINT16(save->p, players[i].momentboost);
|
||||
WRITEUINT8(save->p, players[i].sparkleanim);
|
||||
WRITEUINT16(save->p, players[i].superring);
|
||||
WRITEUINT16(save->p, players[i].superringdisplay);
|
||||
|
|
@ -1230,6 +1231,7 @@ static void P_NetUnArchivePlayers(savebuffer_t *save)
|
|||
players[i].pickuprings = READUINT8(save->p);
|
||||
players[i].ringdelay = READUINT8(save->p);
|
||||
players[i].ringboost = READUINT16(save->p);
|
||||
players[i].momentboost = READUINT16(save->p);
|
||||
players[i].sparkleanim = READUINT8(save->p);
|
||||
players[i].superring = READUINT16(save->p);
|
||||
players[i].superringdisplay = READUINT16(save->p);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue