mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Fix ring usage & gravity
This commit is contained in:
parent
51aef1ce75
commit
8fd64ca607
10 changed files with 32 additions and 68 deletions
|
|
@ -441,7 +441,7 @@ consvar_t cv_kartdebugcolorize = {"kartdebugcolorize", "Off", CV_NOSHOWHELP, CV_
|
|||
static CV_PossibleValue_t votetime_cons_t[] = {{10, "MIN"}, {3600, "MAX"}, {0, NULL}};
|
||||
consvar_t cv_votetime = {"votetime", "20", CV_NETVAR, votetime_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_gravity = {"gravity", "0.8", CV_RESTRICT|CV_FLOAT|CV_CALL, NULL, Gravity_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_gravity = {"gravity", "0.8", CV_RESTRICT|CV_FLOAT|CV_CALL, NULL, Gravity_OnChange, 0, NULL, NULL, 0, 0, NULL}; // change DEFAULT_GRAVITY if you change this
|
||||
|
||||
consvar_t cv_soundtest = {"soundtest", "0", CV_CALL, NULL, SoundTest_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
|
|
|
|||
|
|
@ -432,7 +432,7 @@ typedef enum
|
|||
} karthudtype_t;
|
||||
|
||||
// QUICKLY GET RING TOTAL, INCLUDING RINGS CURRENTLY IN THE PICKUP ANIMATION
|
||||
#define RINGTOTAL(p) (p->kartstuff[k_rings] + p->kartstuff[k_pickuprings])
|
||||
#define RINGTOTAL(p) (p->rings + p->kartstuff[k_pickuprings])
|
||||
|
||||
//}
|
||||
|
||||
|
|
|
|||
|
|
@ -645,6 +645,7 @@ extern mobj_t *hunt1, *hunt2, *hunt3; // Emerald hunt locations
|
|||
// For racing
|
||||
extern tic_t racecountdown, exitcountdown;
|
||||
|
||||
#define DEFAULT_GRAVITY (4*FRACUNIT/5)
|
||||
extern fixed_t gravity;
|
||||
extern fixed_t mapobjectscale;
|
||||
|
||||
|
|
|
|||
14
src/info.c
14
src/info.c
|
|
@ -7880,17 +7880,17 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
sfx_None, // painsound
|
||||
S_NULL, // meleestate
|
||||
S_NULL, // missilestate
|
||||
S_SPRK1, // deathstate
|
||||
S_NULL, // deathstate
|
||||
S_NULL, // xdeathstate
|
||||
sfx_itemup, // deathsound
|
||||
38*FRACUNIT, // speed
|
||||
16*FRACUNIT, // radius
|
||||
24*FRACUNIT, // height
|
||||
48*FRACUNIT, // radius
|
||||
48*FRACUNIT, // height
|
||||
0, // display offset
|
||||
100, // mass
|
||||
0, // damage
|
||||
sfx_None, // activesound
|
||||
MF_SLIDEME|MF_SPECIAL|MF_NOGRAVITY|MF_NOCLIPHEIGHT, // flags
|
||||
MF_SLIDEME|MF_SPECIAL|MF_NOGRAVITY|MF_NOCLIPHEIGHT|MF_DONTENCOREMAP, // flags
|
||||
S_NULL // raisestate
|
||||
},
|
||||
|
||||
|
|
@ -7911,13 +7911,13 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
S_NULL, // xdeathstate
|
||||
sfx_itemup, // deathsound
|
||||
38*FRACUNIT, // speed
|
||||
15*FRACUNIT, // radius
|
||||
24*FRACUNIT, // height
|
||||
24*FRACUNIT, // radius
|
||||
48*FRACUNIT, // height
|
||||
0, // display offset
|
||||
100, // mass
|
||||
0, // damage
|
||||
sfx_None, // activesound
|
||||
MF_SLIDEME|MF_SPECIAL, // flags
|
||||
MF_SLIDEME|MF_BOUNCE|MF_SPECIAL|MF_DONTENCOREMAP, // flags
|
||||
S_NULL // raisestate
|
||||
},
|
||||
|
||||
|
|
|
|||
12
src/k_hud.c
12
src/k_hud.c
|
|
@ -1794,15 +1794,15 @@ static void K_drawKartLapsAndRings(void)
|
|||
boolean colorring = false;
|
||||
INT32 ringx = 0;
|
||||
|
||||
rn[0] = ((abs(stplyr->kartstuff[k_rings]) / 10) % 10);
|
||||
rn[1] = (abs(stplyr->kartstuff[k_rings]) % 10);
|
||||
rn[0] = ((abs(stplyr->rings) / 10) % 10);
|
||||
rn[1] = (abs(stplyr->rings) % 10);
|
||||
|
||||
if (stplyr->kartstuff[k_rings] <= 0 && (leveltime/5 & 1)) // In debt
|
||||
if (stplyr->rings <= 0 && (leveltime/5 & 1)) // In debt
|
||||
{
|
||||
ringmap = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_CRIMSON, GTC_CACHE);
|
||||
colorring = true;
|
||||
}
|
||||
else if (stplyr->kartstuff[k_rings] >= 20) // Maxed out
|
||||
else if (stplyr->rings >= 20) // Maxed out
|
||||
ringmap = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_YELLOW, GTC_CACHE);
|
||||
|
||||
if (stplyr->karthud[khud_ringframe] > RINGANIM_FLIPFRAME)
|
||||
|
|
@ -1881,7 +1881,7 @@ static void K_drawKartLapsAndRings(void)
|
|||
|
||||
V_DrawMappedPatch(fr+ringx, fy-13, V_HUDTRANS|V_SLIDEIN|splitflags|ringflip, kp_smallring[ringanim_realframe], (colorring ? ringmap : NULL));
|
||||
|
||||
if (stplyr->kartstuff[k_rings] < 0) // Draw the minus for ring debt
|
||||
if (stplyr->rings < 0) // Draw the minus for ring debt
|
||||
V_DrawMappedPatch(fr+7, fy-10, V_HUDTRANS|V_SLIDEIN|splitflags, kp_ringdebtminussmall, ringmap);
|
||||
|
||||
V_DrawMappedPatch(fr+11, fy-10, V_HUDTRANS|V_SLIDEIN|splitflags, fontv[PINGNUM_FONT].font[rn[0]], ringmap);
|
||||
|
|
@ -1917,7 +1917,7 @@ static void K_drawKartLapsAndRings(void)
|
|||
|
||||
V_DrawMappedPatch(LAPS_X+ringx+7, LAPS_Y-16, V_HUDTRANS|V_SLIDEIN|splitflags|ringflip, kp_ring[ringanim_realframe], (colorring ? ringmap : NULL));
|
||||
|
||||
if (stplyr->kartstuff[k_rings] < 0) // Draw the minus for ring debt
|
||||
if (stplyr->rings < 0) // Draw the minus for ring debt
|
||||
{
|
||||
V_DrawMappedPatch(LAPS_X+23, LAPS_Y-11, V_HUDTRANS|V_SLIDEIN|splitflags, kp_ringdebtminus, ringmap);
|
||||
V_DrawMappedPatch(LAPS_X+29, LAPS_Y-11, V_HUDTRANS|V_SLIDEIN|splitflags, kp_facenum[rn[0]], ringmap);
|
||||
|
|
|
|||
22
src/k_kart.c
22
src/k_kart.c
|
|
@ -1231,7 +1231,7 @@ void K_KartBouncing(mobj_t *mobj1, mobj_t *mobj2, boolean bounce, boolean solid)
|
|||
else if (mobj2->player // Player VS player bumping only
|
||||
&& (K_GetShieldFromItem(mobj1->player->kartstuff[k_itemtype]) == KSHIELD_NONE)) // Ignore for shields
|
||||
{
|
||||
if (mobj1->player->kartstuff[k_rings] <= 0)
|
||||
if (mobj1->player->rings <= 0)
|
||||
{
|
||||
K_DebtStingPlayer(mobj1->player, TICRATE + (4 * (mobj2->player->kartweight - mobj1->player->kartweight)));
|
||||
K_KartPainEnergyFling(mobj1->player);
|
||||
|
|
@ -1257,7 +1257,7 @@ void K_KartBouncing(mobj_t *mobj1, mobj_t *mobj2, boolean bounce, boolean solid)
|
|||
else if (mobj1->player // Player VS player bumping only
|
||||
&& (K_GetShieldFromItem(mobj2->player->kartstuff[k_itemtype]) == KSHIELD_NONE)) // Ignore for shields
|
||||
{
|
||||
if (mobj2->player->kartstuff[k_rings] <= 0)
|
||||
if (mobj2->player->rings <= 0)
|
||||
{
|
||||
K_DebtStingPlayer(mobj2->player, TICRATE + (4 * (mobj1->player->kartweight - mobj2->player->kartweight)));
|
||||
K_KartPainEnergyFling(mobj2->player);
|
||||
|
|
@ -5339,7 +5339,7 @@ void K_KartPlayerHUDUpdate(player_t *player)
|
|||
|
||||
if (player->karthud[khud_ringspblock] >= 14) // debt animation
|
||||
{
|
||||
if ((player->kartstuff[k_rings] > 0) // Get out of 0 ring animation
|
||||
if ((player->rings > 0) // Get out of 0 ring animation
|
||||
&& (normalanim == 3 || normalanim == 10)) // on these transition frames.
|
||||
player->karthud[khud_ringspblock] = normalanim;
|
||||
else
|
||||
|
|
@ -5347,7 +5347,7 @@ void K_KartPlayerHUDUpdate(player_t *player)
|
|||
}
|
||||
else // normal animation
|
||||
{
|
||||
if ((player->kartstuff[k_rings] <= 0) // Go into 0 ring animation
|
||||
if ((player->rings <= 0) // Go into 0 ring animation
|
||||
&& (player->karthud[khud_ringspblock] == 1 || player->karthud[khud_ringspblock] == 8)) // on these transition frames.
|
||||
player->karthud[khud_ringspblock] = debtanim;
|
||||
else
|
||||
|
|
@ -5553,7 +5553,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
|
|||
}
|
||||
}
|
||||
|
||||
if (gametype == GT_RACE && player->kartstuff[k_rings] <= 0) // spawn ring debt indicator
|
||||
if (gametype == GT_RACE && player->rings <= 0) // spawn ring debt indicator
|
||||
{
|
||||
mobj_t *debtflag = P_SpawnMobj(player->mo->x + player->mo->momx, player->mo->y + player->mo->momy,
|
||||
player->mo->z + player->mo->momz + player->mo->height + (24*player->mo->scale), MT_THOK);
|
||||
|
|
@ -5736,10 +5736,10 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
|
|||
}
|
||||
}
|
||||
|
||||
if (player->kartstuff[k_rings] > 20)
|
||||
player->kartstuff[k_rings] = 20;
|
||||
else if (player->kartstuff[k_rings] < -20)
|
||||
player->kartstuff[k_rings] = -20;
|
||||
if (player->rings > 20)
|
||||
player->rings = 20;
|
||||
else if (player->rings < -20)
|
||||
player->rings = -20;
|
||||
|
||||
if (player->kartstuff[k_ringdelay])
|
||||
player->kartstuff[k_ringdelay]--;
|
||||
|
|
@ -7086,7 +7086,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
|
|||
// Ring boosting
|
||||
if (player->kartstuff[k_userings])
|
||||
{
|
||||
if ((player->pflags & PF_ATTACKDOWN) && !player->kartstuff[k_ringdelay] && player->kartstuff[k_rings] > 0)
|
||||
if ((player->pflags & PF_ATTACKDOWN) && !player->kartstuff[k_ringdelay] && player->rings > 0)
|
||||
{
|
||||
mobj_t *ring = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_RING);
|
||||
P_SetMobjState(ring, S_FASTRING1);
|
||||
|
|
@ -7094,7 +7094,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
|
|||
ring->extravalue2 = 1; // Ring use animation flag
|
||||
ring->shadowscale = 0;
|
||||
P_SetTarget(&ring->target, player->mo); // user
|
||||
player->kartstuff[k_rings]--;
|
||||
player->rings--;
|
||||
player->kartstuff[k_ringdelay] = 3;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4186,7 +4186,7 @@ void A_AttractChase(mobj_t *actor)
|
|||
{
|
||||
if (actor->extravalue1 >= 16)
|
||||
{
|
||||
if (actor->target->player->kartstuff[k_rings] >= 20)
|
||||
if (actor->target->player->rings >= 20)
|
||||
actor->target->player->kartstuff[k_ringboost] += K_GetKartRingPower(actor->target->player)+3;
|
||||
else
|
||||
P_GivePlayerRings(actor->target->player, 1);
|
||||
|
|
|
|||
|
|
@ -1925,7 +1925,7 @@ void P_PlayerRingBurst(player_t *player, INT32 num_rings)
|
|||
return;
|
||||
|
||||
// Cap the maximum loss automatically to 2 in ring debt
|
||||
if (player->kartstuff[k_rings] <= 0 && num_rings > 2)
|
||||
if (player->rings <= 0 && num_rings > 2)
|
||||
num_rings = 2;
|
||||
|
||||
P_GivePlayerRings(player, -num_rings);
|
||||
|
|
|
|||
|
|
@ -366,7 +366,7 @@ static void P_ClearSingleMapHeaderInfo(INT16 i)
|
|||
mapheaderinfo[num]->startrings = 0;
|
||||
mapheaderinfo[num]->sstimer = 90;
|
||||
mapheaderinfo[num]->ssspheres = 1;
|
||||
mapheaderinfo[num]->gravity = FRACUNIT/2;
|
||||
mapheaderinfo[num]->gravity = DEFAULT_GRAVITY;
|
||||
mapheaderinfo[num]->keywords[0] = '\0';
|
||||
snprintf(mapheaderinfo[num]->musname, 7, "%sM", G_BuildMapName(i));
|
||||
mapheaderinfo[num]->musname[6] = 0;
|
||||
|
|
|
|||
41
src/p_user.c
41
src/p_user.c
|
|
@ -499,7 +499,7 @@ void P_GivePlayerRings(player_t *player, INT32 num_rings)
|
|||
if ((gametyperules & GTR_BUMPERS)) // No rings in Battle Mode
|
||||
return;
|
||||
|
||||
player->kartstuff[k_rings] += num_rings;
|
||||
player->rings += num_rings;
|
||||
//player->totalring += num_rings; // Used for GP lives later
|
||||
|
||||
if (player->rings > 20)
|
||||
|
|
@ -673,7 +673,7 @@ void P_PlayRinglossSound(mobj_t *source)
|
|||
{
|
||||
if (source->player && K_GetShieldFromItem(source->player->kartstuff[k_itemtype]) != KSHIELD_NONE)
|
||||
S_StartSound(source, sfx_s1a3); // Shield hit (no ring loss)
|
||||
else if (source->player && source->player->kartstuff[k_rings] <= 0)
|
||||
else if (source->player && source->player->rings <= 0)
|
||||
S_StartSound(source, sfx_s1a6); // Ring debt (lessened ring loss)
|
||||
else
|
||||
S_StartSound(source, sfx_s1c6); // Normal ring loss sound
|
||||
|
|
@ -4437,43 +4437,6 @@ void P_PlayerThink(player_t *player)
|
|||
return; // player->mo was removed.*/
|
||||
}
|
||||
|
||||
// Even if not NiGHTS, pull in nearby objects when walking around as John Q. Elliot.
|
||||
if (!objectplacing && !((netgame || multiplayer) && player->spectator))
|
||||
{
|
||||
thinker_t *th;
|
||||
mobj_t *mo2;
|
||||
fixed_t x = player->mo->x;
|
||||
fixed_t y = player->mo->y;
|
||||
fixed_t z = player->mo->z;
|
||||
|
||||
for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next)
|
||||
{
|
||||
if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed)
|
||||
continue;
|
||||
|
||||
mo2 = (mobj_t *)th;
|
||||
|
||||
if (!(mo2->type == MT_RING || mo2->type == MT_COIN
|
||||
|| mo2->type == MT_BLUESPHERE || mo2->type == MT_BOMBSPHERE
|
||||
|| mo2->type == MT_NIGHTSCHIP || mo2->type == MT_NIGHTSSTAR))
|
||||
continue;
|
||||
|
||||
if (mo2->flags2 & MF2_NIGHTSPULL)
|
||||
continue;
|
||||
|
||||
if (P_AproxDistance(P_AproxDistance(mo2->x - x, mo2->y - y), mo2->z - z) > FixedMul(128*FRACUNIT, player->mo->scale))
|
||||
continue;
|
||||
|
||||
// Yay! The thing's in reach! Pull it in!
|
||||
mo2->flags |= MF_NOCLIP|MF_NOCLIPHEIGHT;
|
||||
mo2->flags2 |= MF2_NIGHTSPULL;
|
||||
// New NiGHTS attract speed dummied out because the older behavior
|
||||
// is exploited as a mechanic. Uncomment to enable.
|
||||
mo2->movefactor = 0; // 40*FRACUNIT; // initialize the NightsItemChase timer
|
||||
P_SetTarget(&mo2->tracer, player->mo);
|
||||
}
|
||||
}
|
||||
|
||||
if (player->linktimer && !player->powers[pw_nights_linkfreeze])
|
||||
{
|
||||
if (--player->linktimer <= 0) // Link timer
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue