mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Merge branch 'amps' into 'master'
Overdrive! See merge request KartKrew/Kart!2414
This commit is contained in:
commit
4bf99e7f16
18 changed files with 699 additions and 5 deletions
|
|
@ -1029,6 +1029,14 @@ struct player_t
|
|||
UINT8 ringboxdelay; // Delay until Ring Box auto-activates
|
||||
UINT8 ringboxaward; // Where did we stop?
|
||||
|
||||
UINT8 amps;
|
||||
UINT8 amppickup;
|
||||
UINT8 ampspending;
|
||||
|
||||
UINT16 overdrive;
|
||||
UINT16 overshield;
|
||||
fixed_t overdrivepower;
|
||||
|
||||
UINT8 itemflags; // holds IF_ flags (see itemflags_t)
|
||||
|
||||
fixed_t outrun; // Milky Way road effect
|
||||
|
|
|
|||
|
|
@ -1568,6 +1568,10 @@ const char *const STATE_LIST[] = { // array length left dynamic for sanity testi
|
|||
"S_BLOCKRING",
|
||||
"S_BLOCKBODY",
|
||||
|
||||
"S_AMPRING",
|
||||
"S_AMPBODY",
|
||||
"S_AMPAURA",
|
||||
|
||||
"S_CHARGEAURA",
|
||||
"S_CHARGEFALL",
|
||||
"S_CHARGEFLICKER",
|
||||
|
|
@ -2636,6 +2640,8 @@ const char *const STATE_LIST[] = { // array length left dynamic for sanity testi
|
|||
"S_WAYPOINTSPLAT",
|
||||
"S_EGOORB",
|
||||
|
||||
"S_AMPS",
|
||||
|
||||
"S_WATERTRAIL1",
|
||||
"S_WATERTRAIL2",
|
||||
"S_WATERTRAIL3",
|
||||
|
|
@ -3505,6 +3511,10 @@ const char *const MOBJTYPE_LIST[] = { // array length left dynamic for sanity t
|
|||
"MT_BLOCKRING",
|
||||
"MT_BLOCKBODY",
|
||||
|
||||
"MT_AMPRING",
|
||||
"MT_AMPBODY",
|
||||
"MT_AMPAURA",
|
||||
|
||||
"MT_CHARGEAURA",
|
||||
"MT_CHARGEFALL",
|
||||
"MT_CHARGEFLICKER",
|
||||
|
|
@ -3937,6 +3947,8 @@ const char *const MOBJTYPE_LIST[] = { // array length left dynamic for sanity t
|
|||
|
||||
"MT_IPULLUP",
|
||||
"MT_PULLUPHOOK",
|
||||
|
||||
"MT_AMPS",
|
||||
};
|
||||
|
||||
const char *const MOBJFLAG_LIST[] = {
|
||||
|
|
|
|||
118
src/info.c
118
src/info.c
|
|
@ -577,6 +577,11 @@ char sprnames[NUMSPRITES + 1][5] =
|
|||
"WAYP",
|
||||
"EGOO",
|
||||
|
||||
"AMPA",
|
||||
"AMPB",
|
||||
"AMPC",
|
||||
"AMPD",
|
||||
|
||||
"WTRL", // Water Trail
|
||||
|
||||
"GCHA", // follower: generic chao
|
||||
|
|
@ -2122,6 +2127,10 @@ state_t states[NUMSTATES] =
|
|||
{SPR_GRNG, FF_FULLBRIGHT|FF_PAPERSPRITE|0, -1, {NULL}, 0, 0, S_NULL}, // S_BLOCKRING
|
||||
{SPR_GBDY, FF_FULLBRIGHT|FF_ANIMATE|0, -1, {NULL}, 4, 2, S_NULL}, // S_BLOCKBODY
|
||||
|
||||
{SPR_AMPB, FF_FULLBRIGHT|FF_PAPERSPRITE|0, -1, {NULL}, 0, 0, S_NULL}, // S_AMPRING
|
||||
{SPR_AMPC, FF_FULLBRIGHT|FF_ANIMATE|0, -1, {NULL}, 4, 2, S_NULL}, // S_AMPBODY
|
||||
{SPR_AMPD, FF_FULLBRIGHT|FF_ANIMATE|0, -1, {NULL}, 4, 2, S_NULL}, // S_AMPAURA
|
||||
|
||||
{SPR_TRC1, FF_FULLBRIGHT|FF_ANIMATE|0, -1, {NULL}, 4, 2, S_NULL}, // S_CHARGEAURA
|
||||
{SPR_TRC2, FF_FULLBRIGHT|FF_ANIMATE|0, 20, {NULL}, 19, 1, S_NULL}, // S_CHARGEFALL
|
||||
{SPR_TRC3, FF_FULLBRIGHT|FF_ADD|0, 2, {NULL}, 0, 0, S_NULL}, // S_CHARGEFLICKER
|
||||
|
|
@ -3168,6 +3177,8 @@ state_t states[NUMSTATES] =
|
|||
{SPR_WAYP, 1|FF_FLOORSPRITE, 1, {NULL}, 0, 0, S_NULL}, // S_WAYPOINTSPLAT
|
||||
{SPR_EGOO, 0, 1, {NULL}, 0, 0, S_NULL}, // S_EGOORB
|
||||
|
||||
{SPR_AMPA, FF_FULLBRIGHT, -1, {NULL}, 0, 0, S_NULL}, // S_AMPS
|
||||
|
||||
// Water Trail
|
||||
{SPR_WTRL, FF_PAPERSPRITE , 2, {NULL}, 0, 0, S_NULL}, // S_WATERTRAIL1
|
||||
{SPR_WTRL, FF_PAPERSPRITE|1, 2, {NULL}, 0, 0, S_NULL}, // S_WATERTRAIL2
|
||||
|
|
@ -13629,6 +13640,87 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
S_NULL // raisestate
|
||||
},
|
||||
|
||||
{ // MT_AMPRING
|
||||
-1, // doomednum
|
||||
S_AMPRING, // spawnstate
|
||||
1000, // spawnhealth
|
||||
S_NULL, // seestate
|
||||
sfx_None, // seesound
|
||||
0, // reactiontime
|
||||
sfx_None, // attacksound
|
||||
S_NULL, // painstate
|
||||
0, // painchance
|
||||
sfx_None, // painsound
|
||||
S_NULL, // meleestate
|
||||
S_NULL, // missilestate
|
||||
S_NULL, // deathstate
|
||||
S_NULL, // xdeathstate
|
||||
sfx_None, // deathsound
|
||||
0, // speed
|
||||
67*FRACUNIT, // radius
|
||||
67*FRACUNIT, // height
|
||||
3, // display offset
|
||||
100, // mass
|
||||
0, // damage
|
||||
sfx_None, // activesound
|
||||
MF_NOGRAVITY|MF_NOCLIPHEIGHT, // flags
|
||||
S_NULL // raisestate
|
||||
},
|
||||
|
||||
{ // MT_AMPBODY
|
||||
-1, // doomednum
|
||||
S_AMPBODY, // spawnstate
|
||||
1000, // spawnhealth
|
||||
S_NULL, // seestate
|
||||
sfx_None, // seesound
|
||||
0, // reactiontime
|
||||
sfx_None, // attacksound
|
||||
S_NULL, // painstate
|
||||
0, // painchance
|
||||
sfx_None, // painsound
|
||||
S_NULL, // meleestate
|
||||
S_NULL, // missilestate
|
||||
S_NULL, // deathstate
|
||||
S_NULL, // xdeathstate
|
||||
sfx_None, // deathsound
|
||||
0, // speed
|
||||
67*FRACUNIT, // radius
|
||||
67*FRACUNIT, // height
|
||||
2, // display offset
|
||||
100, // mass
|
||||
0, // damage
|
||||
sfx_None, // activesound
|
||||
MF_NOGRAVITY|MF_NOCLIPHEIGHT, // flags
|
||||
S_NULL // raisestate
|
||||
},
|
||||
|
||||
{ // MT_AMPAURA
|
||||
-1, // doomednum
|
||||
S_AMPAURA, // spawnstate
|
||||
1000, // spawnhealth
|
||||
S_NULL, // seestate
|
||||
sfx_None, // seesound
|
||||
0, // reactiontime
|
||||
sfx_None, // attacksound
|
||||
S_NULL, // painstate
|
||||
0, // painchance
|
||||
sfx_None, // painsound
|
||||
S_NULL, // meleestate
|
||||
S_NULL, // missilestate
|
||||
S_NULL, // deathstate
|
||||
S_NULL, // xdeathstate
|
||||
sfx_None, // deathsound
|
||||
0, // speed
|
||||
67*FRACUNIT, // radius
|
||||
67*FRACUNIT, // height
|
||||
1, // display offset
|
||||
100, // mass
|
||||
0, // damage
|
||||
sfx_None, // activesound
|
||||
MF_NOGRAVITY|MF_NOCLIPHEIGHT, // flags
|
||||
S_NULL // raisestate
|
||||
},
|
||||
|
||||
{ // MT_CHARGEAURA
|
||||
-1, // doomednum
|
||||
S_CHARGEAURA, // spawnstate
|
||||
|
|
@ -22073,6 +22165,32 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
MF_NOCLIPHEIGHT|MF_SPECIAL|MF_NOGRAVITY|MF_NOCLIP, // flags
|
||||
S_NULL // raisestate
|
||||
},
|
||||
{ // MT_AMPS
|
||||
3444, // doomednum
|
||||
S_AMPS, // spawnstate
|
||||
1000, // spawnhealth
|
||||
S_NULL, // seestate
|
||||
sfx_None, // seesound
|
||||
0, // reactiontime
|
||||
sfx_None, // attacksound
|
||||
S_NULL, // painstate
|
||||
0, // painchance
|
||||
sfx_None, // painsound
|
||||
S_NULL, // meleestate
|
||||
S_NULL, // missilestate
|
||||
S_NULL, // deathstate
|
||||
S_NULL, // xdeathstate
|
||||
sfx_None, // deathsound
|
||||
1, // speed
|
||||
32*FRACUNIT, // radius
|
||||
32*FRACUNIT, // height
|
||||
0, // dispoffset
|
||||
0, // mass
|
||||
0, // damage
|
||||
sfx_None, // activesound
|
||||
MF_NOGRAVITY|MF_NOCLIPHEIGHT|MF_NOCLIP|MF_NOCLIPTHING, // flags
|
||||
S_NULL // raisestate
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
17
src/info.h
17
src/info.h
|
|
@ -1116,6 +1116,11 @@ typedef enum sprite
|
|||
SPR_WAYP,
|
||||
SPR_EGOO,
|
||||
|
||||
SPR_AMPA,
|
||||
SPR_AMPB,
|
||||
SPR_AMPC,
|
||||
SPR_AMPD,
|
||||
|
||||
SPR_WTRL, // Water Trail
|
||||
|
||||
SPR_GCHA, // follower: generic chao
|
||||
|
|
@ -2590,6 +2595,10 @@ typedef enum state
|
|||
S_BLOCKRING,
|
||||
S_BLOCKBODY,
|
||||
|
||||
S_AMPRING,
|
||||
S_AMPBODY,
|
||||
S_AMPAURA,
|
||||
|
||||
S_CHARGEAURA,
|
||||
S_CHARGEFALL,
|
||||
S_CHARGEFLICKER,
|
||||
|
|
@ -3662,6 +3671,8 @@ typedef enum state
|
|||
S_WAYPOINTSPLAT,
|
||||
S_EGOORB,
|
||||
|
||||
S_AMPS,
|
||||
|
||||
S_WATERTRAIL1,
|
||||
S_WATERTRAIL2,
|
||||
S_WATERTRAIL3,
|
||||
|
|
@ -4554,6 +4565,10 @@ typedef enum mobj_type
|
|||
MT_BLOCKRING,
|
||||
MT_BLOCKBODY,
|
||||
|
||||
MT_AMPRING,
|
||||
MT_AMPBODY,
|
||||
MT_AMPAURA,
|
||||
|
||||
MT_CHARGEAURA,
|
||||
MT_CHARGEFALL,
|
||||
MT_CHARGEFLICKER,
|
||||
|
|
@ -4990,6 +5005,8 @@ typedef enum mobj_type
|
|||
MT_IPULLUP,
|
||||
MT_PULLUPHOOK,
|
||||
|
||||
MT_AMPS,
|
||||
|
||||
MT_FIRSTFREESLOT,
|
||||
MT_LASTFREESLOT = MT_FIRSTFREESLOT + NUMMOBJFREESLOTS - 1,
|
||||
NUMMOBJTYPES
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@
|
|||
#include "m_random.h"
|
||||
#include "k_hud.h" // K_AddMessage
|
||||
#include "m_easing.h"
|
||||
#include "r_skins.h"
|
||||
|
||||
angle_t K_GetCollideAngle(mobj_t *t1, mobj_t *t2)
|
||||
{
|
||||
|
|
@ -694,6 +695,11 @@ boolean K_DropTargetCollide(mobj_t *t1, mobj_t *t2)
|
|||
S_StartSound(t2, sfx_kdtrg1);
|
||||
}
|
||||
|
||||
if (t1->tracer && t1->tracer->player)
|
||||
{
|
||||
K_SpawnAmps(t1->tracer->player, 20, t1);
|
||||
}
|
||||
|
||||
if (draggeddroptarget && !P_MobjWasRemoved(draggeddroptarget) && draggeddroptarget->player)
|
||||
{
|
||||
// The following removes t1, be warned
|
||||
|
|
@ -1188,6 +1194,7 @@ boolean K_PvPTouchDamage(mobj_t *t1, mobj_t *t2)
|
|||
auto doStumble = [](mobj_t *t1, mobj_t *t2)
|
||||
{
|
||||
K_StumblePlayer(t2->player);
|
||||
K_SpawnAmps(t1->player, 20, t2);
|
||||
};
|
||||
|
||||
if (forEither(shouldStumble, doStumble))
|
||||
|
|
|
|||
|
|
@ -107,6 +107,9 @@ static patch_t *kp_ringdebtminus;
|
|||
static patch_t *kp_ringdebtminussmall;
|
||||
static patch_t *kp_ringspblock[16];
|
||||
static patch_t *kp_ringspblocksmall[16];
|
||||
static patch_t *kp_amps[7][12];
|
||||
static patch_t *kp_amps_underlay[12];
|
||||
static patch_t *kp_overdrive[32];
|
||||
|
||||
static patch_t *kp_speedometersticker;
|
||||
static patch_t *kp_speedometerlabel[4];
|
||||
|
|
@ -417,6 +420,47 @@ void K_LoadKartHUDGraphics(void)
|
|||
HU_UpdatePatch(&kp_ring[i], "%s", buffer);
|
||||
}
|
||||
|
||||
// Amps
|
||||
{
|
||||
// Levels 1-6
|
||||
sprintf(buffer, "b_xAMPxx");
|
||||
for (i = 0; i < 6; i++)
|
||||
{
|
||||
buffer[2] = '0'+i+1;
|
||||
for (j = 0; j < 12; j++)
|
||||
{
|
||||
buffer[6] = '0'+((j) / 10);
|
||||
buffer[7] = '0'+((j) % 10);
|
||||
HU_UpdatePatch(&kp_amps[i][j], "%s", buffer);
|
||||
}
|
||||
}
|
||||
|
||||
// Level 7
|
||||
buffer[2] = '7';
|
||||
buffer[1] = 'A';
|
||||
for (j = 0; j < 12; j++)
|
||||
{
|
||||
buffer[6] = '0'+((j) / 10);
|
||||
buffer[7] = '0'+((j) % 10);
|
||||
HU_UpdatePatch(&kp_amps[i][j], "%s", buffer);
|
||||
}
|
||||
buffer[1] = 'B';
|
||||
for (j = 0; j < 12; j++)
|
||||
{
|
||||
buffer[6] = '0'+((j) / 10);
|
||||
buffer[7] = '0'+((j) % 10);
|
||||
HU_UpdatePatch(&kp_amps_underlay[j], "%s", buffer);
|
||||
}
|
||||
}
|
||||
|
||||
sprintf(buffer, "b_OVRDxx");
|
||||
for (i = 0; i < 32; i++)
|
||||
{
|
||||
buffer[6] = '0'+((i) / 10);
|
||||
buffer[7] = '0'+((i) % 10);
|
||||
HU_UpdatePatch(&kp_overdrive[i], "%s", buffer);
|
||||
}
|
||||
|
||||
HU_UpdatePatch(&kp_ringdebtminus, "RDEBTMIN");
|
||||
|
||||
sprintf(buffer, "SPBRNGxx");
|
||||
|
|
@ -3125,8 +3169,28 @@ static void K_drawRingCounter(boolean gametypeinfoshown)
|
|||
.align(Draw::Align::kCenter)
|
||||
.width(uselives ? (stplyr->lives >= 10 ? 70 : 64) : 33)
|
||||
.small_sticker();
|
||||
|
||||
if (stplyr->overdrive)
|
||||
{
|
||||
V_DrawMappedPatch(LAPS_X+7-8, fy-5-8, V_HUDTRANS|V_SLIDEIN|splitflags, kp_overdrive[leveltime%32], R_GetTranslationColormap(TC_RAINBOW, static_cast<skincolornum_t>(stplyr->skincolor), GTC_CACHE));
|
||||
}
|
||||
else
|
||||
{
|
||||
V_DrawMappedPatch(LAPS_X+ringx+7, fy-5, V_HUDTRANS|V_SLIDEIN|splitflags|ringflip, kp_ring[ringanim_realframe], (colorring ? ringmap : NULL));
|
||||
|
||||
if (stplyr->amps)
|
||||
{
|
||||
UINT8 amplevel = std::min(stplyr->amps / AMPLEVEL, 6);
|
||||
|
||||
V_DrawMappedPatch(LAPS_X+7-7, fy-5-8, V_HUDTRANS|V_SLIDEIN|splitflags, kp_amps[amplevel][leveltime%12], R_GetTranslationColormap(TC_RAINBOW, static_cast<skincolornum_t>(stplyr->skincolor), GTC_CACHE));
|
||||
if (amplevel == 6)
|
||||
{
|
||||
V_DrawMappedPatch(LAPS_X+7-7, fy-5-8, V_ADD|V_HUDTRANS|V_SLIDEIN|splitflags, kp_amps_underlay[leveltime%12], R_GetTranslationColormap(TC_RAINBOW, static_cast<skincolornum_t>(stplyr->skincolor), GTC_CACHE));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
V_DrawMappedPatch(LAPS_X+ringx+7, fy-5, V_HUDTRANS|V_SLIDEIN|splitflags|ringflip, kp_ring[ringanim_realframe], (colorring ? ringmap : NULL));
|
||||
|
||||
// "Why fy-4? Why LAPS_X+29+1?"
|
||||
// "use magic numbers" - jartha 2024-03-05
|
||||
|
|
|
|||
168
src/k_kart.c
168
src/k_kart.c
|
|
@ -3520,6 +3520,23 @@ static void K_GetKartBoostPower(player_t *player)
|
|||
); // + 80% top speed (peak), +400% acceleration (peak), +20% handling
|
||||
}
|
||||
|
||||
if (player->overdrive)
|
||||
{
|
||||
ADDBOOST(
|
||||
Easing_InCubic(
|
||||
player->overdrivepower,
|
||||
0,
|
||||
5*FRACUNIT/10
|
||||
),
|
||||
Easing_InSine(
|
||||
player->overdrivepower,
|
||||
0,
|
||||
3*FRACUNIT
|
||||
),
|
||||
1*SLIPTIDEHANDLING/5
|
||||
); // + 80% top speed (peak), +400% acceleration (peak), +20% handling
|
||||
}
|
||||
|
||||
if (player->spindashboost) // Spindash boost
|
||||
{
|
||||
const fixed_t MAXCHARGESPEED = K_GetSpindashChargeSpeed(player);
|
||||
|
|
@ -3583,11 +3600,14 @@ static void K_GetKartBoostPower(player_t *player)
|
|||
|
||||
if (player->ringboost) // Ring Boost
|
||||
{
|
||||
fixed_t ringboost_base = FRACUNIT/4;
|
||||
if (player->overdrive)
|
||||
ringboost_base += FRACUNIT/2;
|
||||
// This one's a little special: we add extra top speed per tic of ringboost stored up, to allow for Ring Box to really rocket away.
|
||||
// (We compensate when decrementing ringboost to avoid runaway exponential scaling hell.)
|
||||
fixed_t rb = FixedDiv(player->ringboost * FRACUNIT, max(FRACUNIT, K_RingDurationBoost(player)));
|
||||
ADDBOOST(
|
||||
FRACUNIT/4 + FixedMul(FRACUNIT / 1750, rb),
|
||||
ringboost_base + FixedMul(FRACUNIT / 1750, rb),
|
||||
4*FRACUNIT,
|
||||
Easing_InCubic(min(FRACUNIT, rb / (TICRATE*12)), 0, 2*SLIPTIDEHANDLING/5)
|
||||
); // + 20% + ???% top speed, + 400% acceleration, +???% handling
|
||||
|
|
@ -3977,6 +3997,60 @@ angle_t K_MomentumAngleReal(const mobj_t *mo)
|
|||
}
|
||||
}
|
||||
|
||||
void K_SpawnAmps(player_t *player, UINT8 amps, mobj_t *impact)
|
||||
{
|
||||
if (gametyperules & GTR_SPHERES)
|
||||
return;
|
||||
|
||||
// Give that Sonic guy some help.
|
||||
UINT16 scaledamps = min(amps, amps * (10 + player->kartspeed - player->kartweight) / 10);
|
||||
|
||||
for (int i = 0; i < (scaledamps/2); i++)
|
||||
{
|
||||
mobj_t *pickup = P_SpawnMobj(impact->x, impact->y, impact->z, MT_AMPS);
|
||||
pickup->momx = P_RandomRange(PR_ITEM_DEBRIS, -40*mapobjectscale, 40*mapobjectscale);
|
||||
pickup->momy = P_RandomRange(PR_ITEM_DEBRIS, -40*mapobjectscale, 40*mapobjectscale);
|
||||
pickup->momz = P_RandomRange(PR_ITEM_DEBRIS, -40*mapobjectscale, 40*mapobjectscale);
|
||||
pickup->color = player->skincolor;
|
||||
P_SetTarget(&pickup->target, player->mo);
|
||||
player->ampspending++;
|
||||
}
|
||||
}
|
||||
|
||||
void K_AwardPlayerAmps(player_t *player, UINT8 amps)
|
||||
{
|
||||
UINT16 getamped = player->amps + amps;
|
||||
UINT8 oldamps = player->amps;
|
||||
|
||||
if (getamped > 200)
|
||||
player->amps = 200;
|
||||
else
|
||||
player->amps = getamped;
|
||||
|
||||
player->amppickup = 1;
|
||||
player->ampspending--;
|
||||
|
||||
if (oldamps/AMPLEVEL != player->amps/AMPLEVEL)
|
||||
{
|
||||
UINT8 amplevel = player->amps / AMPLEVEL;
|
||||
static sfxenum_t bwips[7] = {sfx_mbs4c,
|
||||
sfx_mbs4d, sfx_mbs4e, sfx_mbs4f, sfx_mbs50,
|
||||
sfx_mbs51, sfx_mbs52};
|
||||
amplevel = min(amplevel, 6);
|
||||
|
||||
if (P_IsDisplayPlayer(player))
|
||||
{
|
||||
S_StartSound(NULL, bwips[amplevel]);
|
||||
S_StartSound(NULL, bwips[amplevel]);
|
||||
}
|
||||
}
|
||||
|
||||
if (player->rings <= 0 && player->ampspending == 0)
|
||||
{
|
||||
K_Overdrive(player);
|
||||
}
|
||||
}
|
||||
|
||||
void K_AwardPlayerRings(player_t *player, UINT16 rings, boolean overload)
|
||||
{
|
||||
UINT16 superring;
|
||||
|
|
@ -4002,6 +4076,46 @@ void K_AwardPlayerRings(player_t *player, UINT16 rings, boolean overload)
|
|||
player->superring = superring;
|
||||
}
|
||||
|
||||
boolean K_Overdrive(player_t *player)
|
||||
{
|
||||
if (player->amps == 0)
|
||||
return false;
|
||||
|
||||
K_SpawnDriftBoostExplosion(player, 3);
|
||||
K_SpawnDriftElectricSparks(player, player->skincolor, true);
|
||||
S_StartSound(player->mo, sfx_cdfm35);
|
||||
S_StartSound(player->mo, sfx_cdfm13);
|
||||
|
||||
player->overdrive += (player->amps)*6;
|
||||
player->overshield += (player->amps)*2;
|
||||
player->overdrivepower = FRACUNIT;
|
||||
|
||||
player->amps = 0;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
boolean K_DefensiveOverdrive(player_t *player)
|
||||
{
|
||||
if (player->amps == 0)
|
||||
return false;
|
||||
if (player->rings > 0)
|
||||
return false;
|
||||
|
||||
K_SpawnDriftBoostExplosion(player, 3);
|
||||
K_SpawnDriftElectricSparks(player, player->skincolor, true);
|
||||
S_StartSound(player->mo, sfx_cdfm35);
|
||||
S_StartSound(player->mo, sfx_cdfm13);
|
||||
|
||||
player->overdrive += (player->amps)*4;
|
||||
player->overshield += (player->amps)*2 + TICRATE*2;
|
||||
player->overdrivepower = FRACUNIT;
|
||||
|
||||
player->amps = 0;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void K_DoInstashield(player_t *player)
|
||||
{
|
||||
mobj_t *layera;
|
||||
|
|
@ -7254,6 +7368,7 @@ void K_DropHnextList(player_t *player)
|
|||
dropwork->momy = work->momy;
|
||||
dropwork->momz = work->momz;
|
||||
dropwork->reactiontime = work->reactiontime;
|
||||
dropwork->tracer = work->tracer;
|
||||
P_SetMobjState(dropwork, mobjinfo[type].painstate);
|
||||
}
|
||||
}
|
||||
|
|
@ -8995,6 +9110,16 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
|
|||
player->wavedashboost--;
|
||||
}
|
||||
|
||||
if (player->overdrive > 0 && onground == true)
|
||||
{
|
||||
player->overdrive--;
|
||||
}
|
||||
|
||||
if (player->overshield > 0 && onground == true)
|
||||
{
|
||||
player->overshield--;
|
||||
}
|
||||
|
||||
if (player->wavedashboost == 0 || player->wavedashpower > FRACUNIT)
|
||||
{
|
||||
player->wavedashpower = FRACUNIT; // Safety
|
||||
|
|
@ -9051,6 +9176,21 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
|
|||
K_DoIngameRespawn(player);
|
||||
}
|
||||
|
||||
if (player->amppickup && (leveltime%2))
|
||||
{
|
||||
if (P_IsDisplayPlayer(player))
|
||||
{
|
||||
S_StartSoundAtVolume(NULL, sfx_mbs43, 255);
|
||||
S_StartSoundAtVolume(NULL, sfx_mbs43, 255);
|
||||
}
|
||||
else
|
||||
{
|
||||
S_StartSoundAtVolume(NULL, sfx_mbs43, 127);
|
||||
}
|
||||
player->amppickup--;
|
||||
}
|
||||
|
||||
|
||||
// Don't tick down while in damage state.
|
||||
// There may be some maps where the timer activates for
|
||||
// a moment during normal play, but would quickly correct
|
||||
|
|
@ -9717,6 +9857,22 @@ void K_KartResetPlayerColor(player_t *player)
|
|||
goto finalise;
|
||||
}
|
||||
|
||||
if (player->overdrive && (leveltime & 1))
|
||||
{
|
||||
player->mo->colorized = true;
|
||||
fullbright = true;
|
||||
player->mo->color = player->skincolor;
|
||||
goto finalise;
|
||||
|
||||
}
|
||||
else if (player->overdrive)
|
||||
{
|
||||
player->mo->colorized = true;
|
||||
fullbright = true;
|
||||
player->mo->color = SKINCOLOR_WHITE;
|
||||
goto finalise;
|
||||
}
|
||||
|
||||
if (player->ringboost && (leveltime & 1)) // ring boosting
|
||||
{
|
||||
player->mo->colorized = true;
|
||||
|
|
@ -11841,6 +11997,9 @@ static void K_KartSpindashWind(mobj_t *parent)
|
|||
if (parent->player && parent->player->wavedashboost)
|
||||
P_SetScale(wind, wind->scale * 2);
|
||||
|
||||
if (parent->player && parent->player->overdrive)
|
||||
P_SetScale(wind, wind->scale * 2);
|
||||
|
||||
if (parent->momx || parent->momy)
|
||||
wind->angle = R_PointToAngle2(0, 0, parent->momx, parent->momy);
|
||||
else
|
||||
|
|
@ -12755,6 +12914,9 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
|
|||
player->ringdelay = tiereddelay;
|
||||
else
|
||||
player->ringdelay = 3;
|
||||
|
||||
if (player->rings == 0)
|
||||
K_Overdrive(player);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -13063,6 +13225,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
|
|||
mo->movecount = 1;
|
||||
mo->movedir = 1;
|
||||
mo->cusval = player->itemscale;
|
||||
P_SetTarget(&mo->tracer, player->mo);
|
||||
P_SetTarget(&mo->target, player->mo);
|
||||
P_SetTarget(&player->mo->hnext, mo);
|
||||
}
|
||||
|
|
@ -13071,7 +13234,8 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
|
|||
else if (ATTACK_IS_DOWN && (player->itemflags & IF_ITEMOUT))
|
||||
{
|
||||
player->itemamount--;
|
||||
K_ThrowKartItem(player, (player->throwdir > 0), MT_DROPTARGET, -1, 0, 0);
|
||||
mobj_t *drop = K_ThrowKartItem(player, (player->throwdir > 0), MT_DROPTARGET, -1, 0, 0);
|
||||
P_SetTarget(&drop->tracer, player->mo);
|
||||
K_PlayAttackTaunt(player->mo);
|
||||
player->itemflags &= ~IF_ITEMOUT;
|
||||
K_UpdateHnextList(player, true);
|
||||
|
|
|
|||
|
|
@ -50,6 +50,8 @@ Make sure this matches the actual number of states
|
|||
#define MINCOMBOFLOAT (mapobjectscale*1)
|
||||
#define MAXCOMBOTIME (TICRATE*4)
|
||||
|
||||
#define AMPLEVEL (30)
|
||||
|
||||
#define FLAMESHIELD_MAX (120)
|
||||
|
||||
#define RR_PROJECTILE_FUSE (8*TICRATE)
|
||||
|
|
@ -130,7 +132,11 @@ void K_KartPlayerAfterThink(player_t *player);
|
|||
angle_t K_MomentumAngleEx(const mobj_t *mo, const fixed_t threshold);
|
||||
angle_t K_MomentumAngleReal(const mobj_t *mo);
|
||||
#define K_MomentumAngle(mo) K_MomentumAngleEx(mo, 6 * mo->scale)
|
||||
void K_SpawnAmps(player_t *player, UINT8 amps, mobj_t *impact);
|
||||
void K_AwardPlayerAmps(player_t *player, UINT8 amps);
|
||||
void K_AwardPlayerRings(player_t *player, UINT16 rings, boolean overload);
|
||||
boolean K_Overdrive(player_t *player);
|
||||
boolean K_DefensiveOverdrive(player_t *player);
|
||||
void K_DoInstashield(player_t *player);
|
||||
void K_DoPowerClash(mobj_t *t1, mobj_t *t2);
|
||||
void K_DoGuardBreak(mobj_t *t1, mobj_t *t2);
|
||||
|
|
|
|||
|
|
@ -139,6 +139,12 @@ void Obj_BlockRingThink(mobj_t *ring);
|
|||
void Obj_BlockBodyThink(mobj_t *body);
|
||||
void Obj_GuardBreakThink(mobj_t *fx);
|
||||
|
||||
void Obj_AmpRingThink(mobj_t *amp);
|
||||
void Obj_AmpBodyThink(mobj_t *amp);
|
||||
void Obj_AmpAuraThink(mobj_t *amp);
|
||||
|
||||
void Obj_AmpsThink(mobj_t *amps);
|
||||
|
||||
void Obj_ChargeAuraThink(mobj_t *aura);
|
||||
void Obj_ChargeFallThink(mobj_t *charge);
|
||||
void Obj_ChargeReleaseThink(mobj_t *release);
|
||||
|
|
|
|||
|
|
@ -280,6 +280,12 @@ static int player_get(lua_State *L)
|
|||
lua_pushinteger(L, plr->ringboxdelay);
|
||||
else if (fastcmp(field,"ringboxaward"))
|
||||
lua_pushinteger(L, plr->ringboxaward);
|
||||
else if (fastcmp(field,"amps"))
|
||||
lua_pushinteger(L, plr->amps);
|
||||
else if (fastcmp(field,"amppickup"))
|
||||
lua_pushinteger(L, plr->amppickup);
|
||||
else if (fastcmp(field,"ampspending"))
|
||||
lua_pushinteger(L, plr->ampspending);
|
||||
else if (fastcmp(field,"itemflags"))
|
||||
lua_pushinteger(L, plr->itemflags);
|
||||
else if (fastcmp(field,"drift"))
|
||||
|
|
@ -358,8 +364,14 @@ static int player_get(lua_State *L)
|
|||
lua_pushinteger(L, plr->wavedashdelay);
|
||||
else if (fastcmp(field,"wavedashboost"))
|
||||
lua_pushinteger(L, plr->wavedashboost);
|
||||
else if (fastcmp(field,"overdrive"))
|
||||
lua_pushinteger(L, plr->overdrive);
|
||||
else if (fastcmp(field,"overshield"))
|
||||
lua_pushinteger(L, plr->overshield);
|
||||
else if (fastcmp(field,"wavedashpower"))
|
||||
lua_pushinteger(L, plr->wavedashpower);
|
||||
else if (fastcmp(field,"overdrivepower"))
|
||||
lua_pushinteger(L, plr->overdrivepower);
|
||||
else if (fastcmp(field,"speedpunt"))
|
||||
lua_pushinteger(L, plr->speedpunt);
|
||||
else if (fastcmp(field,"trickcharge"))
|
||||
|
|
@ -842,6 +854,12 @@ static int player_set(lua_State *L)
|
|||
plr->ringboxdelay = luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"ringboxaward"))
|
||||
plr->ringboxaward = luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"amps"))
|
||||
plr->amps = luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"amppickup"))
|
||||
plr->amppickup = luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"ampspending"))
|
||||
plr->ampspending = luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"itemflags"))
|
||||
plr->itemflags = luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"drift"))
|
||||
|
|
@ -918,8 +936,14 @@ static int player_set(lua_State *L)
|
|||
plr->wavedashdelay = luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"wavedashboost"))
|
||||
plr->wavedashboost = luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"overdrive"))
|
||||
plr->overdrive = luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"overshield"))
|
||||
plr->overshield = luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"wavedashpower"))
|
||||
plr->wavedashpower = luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"overdrivepower"))
|
||||
plr->overdrivepower = luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"speedpunt"))
|
||||
plr->speedpunt = luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"trickcharge"))
|
||||
|
|
|
|||
|
|
@ -58,6 +58,7 @@ target_sources(SRB2SDL2 PRIVATE
|
|||
adventure-air-booster.c
|
||||
destroyed-kart.cpp
|
||||
pulley.cpp
|
||||
amps.c
|
||||
)
|
||||
|
||||
add_subdirectory(versus)
|
||||
|
|
|
|||
197
src/objects/amps.c
Normal file
197
src/objects/amps.c
Normal file
|
|
@ -0,0 +1,197 @@
|
|||
// DR. ROBOTNIK'S RING RACERS
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 2024 by AJ "Tyron" Martinez.
|
||||
// Copyright (C) 2024 by Kart Krew
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
// See the 'LICENSE' file for more details.
|
||||
//-----------------------------------------------------------------------------
|
||||
/// \file amps.c
|
||||
/// \brief Amps VFX code.
|
||||
|
||||
#include "../doomdef.h"
|
||||
#include "../info.h"
|
||||
#include "../k_objects.h"
|
||||
#include "../p_local.h"
|
||||
#include "../k_kart.h"
|
||||
#include "../k_powerup.h"
|
||||
#include "../m_random.h"
|
||||
#include "../r_main.h"
|
||||
#include "../m_easing.h"
|
||||
|
||||
#define AMP_ARCTIME (8)
|
||||
|
||||
static UINT8 interlacedfuckingthing[] = {6,1,7,2,8,3,9,2,1,1,1,2,1,3,1,2,10,1,11,2,4,3,5,2,1,1,1,2,1,3,1,2};
|
||||
|
||||
void Obj_AmpsThink (mobj_t *amps)
|
||||
{
|
||||
if (P_MobjWasRemoved(amps->target)
|
||||
|| amps->target->health == 0
|
||||
|| amps->target->destscale <= 1 // sealed star fall out
|
||||
|| !amps->target->player)
|
||||
{
|
||||
P_RemoveMobj(amps);
|
||||
}
|
||||
else
|
||||
{
|
||||
mobj_t *mo = amps->target;
|
||||
player_t *player = mo->player;
|
||||
|
||||
fixed_t dist, fakez;
|
||||
angle_t hang, vang;
|
||||
|
||||
UINT8 damper = 3;
|
||||
|
||||
dist = P_AproxDistance(P_AproxDistance(amps->x - mo->x, amps->y - mo->y), amps->z - mo->z);
|
||||
|
||||
fixed_t vert = dist/3;
|
||||
fixed_t speed = 45*amps->scale;
|
||||
|
||||
if (amps->extravalue2) // Mode: going down, aim at the player and speed up / dampen stray movement
|
||||
{
|
||||
if (amps->extravalue1)
|
||||
amps->extravalue1--;
|
||||
|
||||
amps->extravalue2++;
|
||||
|
||||
speed += amps->extravalue1 * amps->scale/2;
|
||||
|
||||
fakez = mo->z + (vert * amps->extravalue1 / AMP_ARCTIME);
|
||||
damper = 1;
|
||||
}
|
||||
else // Mode: going up, aim above the player
|
||||
{
|
||||
amps->extravalue1++;
|
||||
if (amps->extravalue1 >= AMP_ARCTIME)
|
||||
amps->extravalue2 = 1;
|
||||
|
||||
fakez = mo->z + vert;
|
||||
}
|
||||
|
||||
if (mo->flags & MFE_VERTICALFLIP)
|
||||
fakez -= mo->height/2;
|
||||
else
|
||||
fakez += mo->height/2;
|
||||
|
||||
hang = R_PointToAngle2(amps->x, amps->y, mo->x, mo->y);
|
||||
vang = R_PointToAngle2(amps->z, 0, fakez, dist);
|
||||
|
||||
amps->momx -= amps->momx>>(damper), amps->momy -= amps->momy>>(damper), amps->momz -= amps->momz>>(damper);
|
||||
amps->momx += FixedMul(FINESINE(vang>>ANGLETOFINESHIFT), FixedMul(FINECOSINE(hang>>ANGLETOFINESHIFT), speed));
|
||||
amps->momy += FixedMul(FINESINE(vang>>ANGLETOFINESHIFT), FixedMul(FINESINE(hang>>ANGLETOFINESHIFT), speed));
|
||||
amps->momz += FixedMul(FINECOSINE(vang>>ANGLETOFINESHIFT), speed);
|
||||
|
||||
if (dist < (120 * amps->scale) && amps->extravalue2 && !player->amppickup)
|
||||
{
|
||||
K_AwardPlayerAmps(player, 2);
|
||||
P_RemoveMobj(amps);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Obj_AmpRingThink (mobj_t *amps)
|
||||
{
|
||||
if (P_MobjWasRemoved(amps->target) || !amps->target->player)
|
||||
{
|
||||
P_RemoveMobj(amps);
|
||||
}
|
||||
else
|
||||
{
|
||||
mobj_t *mo = amps->target;
|
||||
player_t *player = mo->player;
|
||||
|
||||
amps->flags &= ~(MF_NOCLIPTHING);
|
||||
P_MoveOrigin(amps, mo->x, mo->y, mo->z + mo->height/2);
|
||||
amps->flags |= MF_NOCLIPTHING;
|
||||
|
||||
amps->color = mo->player->skincolor;
|
||||
amps->sprite = SPR_AMPB;
|
||||
amps->frame = interlacedfuckingthing[(leveltime/1)%32]-1;
|
||||
amps->colorized = true;
|
||||
|
||||
if (amps->scale != 3*mo->scale/2)
|
||||
P_InstaScale(amps, 3*mo->scale/2);
|
||||
|
||||
amps->angle = amps->target->angle + (ANG15/2 * leveltime);
|
||||
amps->renderflags |= RF_ADD|RF_PAPERSPRITE|RF_FULLBRIGHT;
|
||||
|
||||
if (player->overshield)
|
||||
amps->renderflags &= ~RF_DONTDRAW;
|
||||
else
|
||||
amps->renderflags |= RF_DONTDRAW;
|
||||
|
||||
if (player->overshield < 35 && player->overshield % 2)
|
||||
amps->renderflags |= RF_DONTDRAW;
|
||||
}
|
||||
}
|
||||
|
||||
void Obj_AmpBodyThink (mobj_t *amps)
|
||||
{
|
||||
if (P_MobjWasRemoved(amps->target) || !amps->target->player)
|
||||
{
|
||||
P_RemoveMobj(amps);
|
||||
}
|
||||
else
|
||||
{
|
||||
mobj_t *mo = amps->target;
|
||||
player_t *player = mo->player;
|
||||
|
||||
amps->flags &= ~(MF_NOCLIPTHING);
|
||||
P_MoveOrigin(amps, mo->x, mo->y, mo->z + mo->height/2);
|
||||
amps->flags |= MF_NOCLIPTHING;
|
||||
|
||||
amps->color = mo->player->skincolor;
|
||||
amps->frame = leveltime%14;
|
||||
amps->colorized = true;
|
||||
|
||||
if (amps->scale != 5*mo->scale/4)
|
||||
P_InstaScale(amps, 5*mo->scale/4);
|
||||
|
||||
amps->angle = amps->target->angle;
|
||||
amps->renderflags |= RF_ADD|RF_FULLBRIGHT;
|
||||
|
||||
if (player->overdrive)
|
||||
amps->renderflags &= ~RF_DONTDRAW;
|
||||
else
|
||||
amps->renderflags |= RF_DONTDRAW;
|
||||
|
||||
if (player->overdrive < 35 && player->overdrive % 2)
|
||||
amps->renderflags |= RF_DONTDRAW;
|
||||
}
|
||||
}
|
||||
|
||||
void Obj_AmpAuraThink (mobj_t *amps)
|
||||
{
|
||||
if (P_MobjWasRemoved(amps->target) || !amps->target->player)
|
||||
{
|
||||
P_RemoveMobj(amps);
|
||||
}
|
||||
else
|
||||
{
|
||||
mobj_t *mo = amps->target;
|
||||
player_t *player = mo->player;
|
||||
|
||||
amps->flags &= ~(MF_NOCLIPTHING);
|
||||
P_MoveOrigin(amps, mo->x, mo->y, mo->z + mo->height/2);
|
||||
amps->flags |= MF_NOCLIPTHING;
|
||||
|
||||
amps->color = mo->player->skincolor;
|
||||
amps->frame = leveltime%2;
|
||||
amps->colorized = true;
|
||||
|
||||
if (amps->scale != 5*mo->scale/4)
|
||||
P_InstaScale(amps, 5*mo->scale/4);
|
||||
|
||||
amps->angle = amps->target->angle;
|
||||
amps->renderflags |= RF_ADD|RF_FULLBRIGHT;
|
||||
|
||||
amps->renderflags &= ~RF_TRANSMASK;
|
||||
amps->renderflags |= (max(3, NUMTRANSMAPS - player->overdrive/TICRATE) << RF_TRANSSHIFT);
|
||||
|
||||
if (!player->overdrive)
|
||||
amps->renderflags |= RF_DONTDRAW;
|
||||
else
|
||||
amps->renderflags &= ~RF_DONTDRAW;
|
||||
}
|
||||
}
|
||||
|
|
@ -32,14 +32,15 @@ void Obj_BlockRingThink (mobj_t *ring)
|
|||
ring->flags &= ~(MF_NOCLIPTHING);
|
||||
P_MoveOrigin(ring, mo->x, mo->y, mo->z + mo->height/2);
|
||||
ring->flags |= MF_NOCLIPTHING;
|
||||
ring->color = mo->color;
|
||||
ring->color = mo->player->skincolor;
|
||||
|
||||
fixed_t baseScale = mo->scale / 2;
|
||||
baseScale += (mo->scale / 30) * player->spheres;
|
||||
|
||||
P_SetScale(ring, baseScale);
|
||||
|
||||
// Twirl
|
||||
ring->angle = ring->target->angle + (ANG15 * leveltime);
|
||||
ring->angle = ring->target->angle + (ANG15/2 * leveltime);
|
||||
// Visuals
|
||||
ring->renderflags |= RF_ADD|RF_PAPERSPRITE;
|
||||
|
||||
|
|
|
|||
|
|
@ -601,6 +601,8 @@ hyudoro_patrol_hit_player
|
|||
|
||||
P_SetTarget(&hyudoro_target(hyu), master);
|
||||
|
||||
K_SpawnAmps(master->player, 20, toucher);
|
||||
|
||||
if (center)
|
||||
P_RemoveMobj(center);
|
||||
|
||||
|
|
|
|||
|
|
@ -3024,6 +3024,11 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
|||
sfx = sfx_s3k3a;
|
||||
clash = true;
|
||||
}
|
||||
else if (player->overshield &&
|
||||
(type != DMG_EXPLODE || inflictor->type != MT_SPBEXPLOSION || !inflictor->movefactor))
|
||||
{
|
||||
clash = true;
|
||||
}
|
||||
else if (player->hyudorotimer > 0)
|
||||
;
|
||||
else
|
||||
|
|
@ -3087,6 +3092,11 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
|||
{
|
||||
K_DoPowerClash(target, inflictor);
|
||||
|
||||
if (inflictor->type != MT_PLAYER)
|
||||
{
|
||||
K_SpawnAmps(player, 5, inflictor);
|
||||
}
|
||||
|
||||
if (inflictor->type == MT_SUPER_FLICKY)
|
||||
{
|
||||
Obj_BlockSuperFlicky(inflictor);
|
||||
|
|
@ -3176,6 +3186,8 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
|||
|
||||
if (source && source != player->mo && source->player)
|
||||
{
|
||||
K_SpawnAmps(source->player, 20, target);
|
||||
|
||||
// Extend the invincibility if the hit was a direct hit.
|
||||
if (inflictor == source && source->player->invincibilitytimer &&
|
||||
!K_PowerUpRemaining(source->player, POWERUP_SMONITOR))
|
||||
|
|
@ -3363,6 +3375,8 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
|||
{
|
||||
player->flipDI = true;
|
||||
}
|
||||
|
||||
K_DefensiveOverdrive(target->player);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
|||
38
src/p_mobj.c
38
src/p_mobj.c
|
|
@ -8580,6 +8580,11 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
|
|||
}
|
||||
break;
|
||||
}
|
||||
case MT_AMPS:
|
||||
{
|
||||
Obj_AmpsThink(mobj);
|
||||
break;
|
||||
}
|
||||
case MT_BLOCKRING:
|
||||
{
|
||||
Obj_BlockRingThink(mobj);
|
||||
|
|
@ -8590,6 +8595,21 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
|
|||
Obj_BlockBodyThink(mobj);
|
||||
break;
|
||||
}
|
||||
case MT_AMPRING:
|
||||
{
|
||||
Obj_AmpRingThink(mobj);
|
||||
break;
|
||||
}
|
||||
case MT_AMPBODY:
|
||||
{
|
||||
Obj_AmpBodyThink(mobj);
|
||||
break;
|
||||
}
|
||||
case MT_AMPAURA:
|
||||
{
|
||||
Obj_AmpAuraThink(mobj);
|
||||
break;
|
||||
}
|
||||
case MT_CHARGEAURA:
|
||||
{
|
||||
Obj_ChargeAuraThink(mobj);
|
||||
|
|
@ -12156,6 +12176,24 @@ void P_SpawnPlayer(INT32 playernum)
|
|||
K_MatchGenericExtraFlags(body, p->mo);
|
||||
body->renderflags |= RF_DONTDRAW;
|
||||
|
||||
mobj_t *aring = P_SpawnMobj(p->mo->x, p->mo->y, p->mo->z, MT_AMPRING);
|
||||
P_SetTarget(å->target, p->mo);
|
||||
P_SetScale(aring, p->mo->scale);
|
||||
K_MatchGenericExtraFlags(aring, p->mo);
|
||||
aring->renderflags |= RF_DONTDRAW;
|
||||
|
||||
mobj_t *abody = P_SpawnMobj(p->mo->x, p->mo->y, p->mo->z, MT_AMPBODY);
|
||||
P_SetTarget(&abody->target, p->mo);
|
||||
P_SetScale(abody, p->mo->scale);
|
||||
K_MatchGenericExtraFlags(abody, p->mo);
|
||||
abody->renderflags |= RF_DONTDRAW;
|
||||
|
||||
mobj_t *aaura = P_SpawnMobj(p->mo->x, p->mo->y, p->mo->z, MT_AMPAURA);
|
||||
P_SetTarget(&aaura->target, p->mo);
|
||||
P_SetScale(aaura, p->mo->scale);
|
||||
K_MatchGenericExtraFlags(aaura, p->mo);
|
||||
aaura->renderflags |= RF_DONTDRAW;
|
||||
|
||||
if (K_PlayerGuard(p))
|
||||
S_StartSound(body, sfx_s1af);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -581,7 +581,10 @@ static void P_NetArchivePlayers(savebuffer_t *save)
|
|||
WRITEUINT16(save->p, players[i].wavedash);
|
||||
WRITEUINT8(save->p, players[i].wavedashdelay);
|
||||
WRITEUINT16(save->p, players[i].wavedashboost);
|
||||
WRITEUINT16(save->p, players[i].overdrive);
|
||||
WRITEUINT16(save->p, players[i].overshield);
|
||||
WRITEFIXED(save->p, players[i].wavedashpower);
|
||||
WRITEFIXED(save->p, players[i].overdrivepower);
|
||||
WRITEUINT16(save->p, players[i].speedpunt);
|
||||
WRITEUINT16(save->p, players[i].trickcharge);
|
||||
|
||||
|
|
@ -627,6 +630,10 @@ static void P_NetArchivePlayers(savebuffer_t *save)
|
|||
WRITEUINT8(save->p, players[i].ringboxdelay);
|
||||
WRITEUINT8(save->p, players[i].ringboxaward);
|
||||
|
||||
WRITEUINT8(save->p, players[i].amps);
|
||||
WRITEUINT8(save->p, players[i].amppickup);
|
||||
WRITEUINT8(save->p, players[i].ampspending);
|
||||
|
||||
WRITEUINT8(save->p, players[i].itemflags);
|
||||
|
||||
WRITEFIXED(save->p, players[i].outrun);
|
||||
|
|
@ -1185,7 +1192,10 @@ static void P_NetUnArchivePlayers(savebuffer_t *save)
|
|||
players[i].wavedash = READUINT16(save->p);
|
||||
players[i].wavedashdelay = READUINT8(save->p);
|
||||
players[i].wavedashboost = READUINT16(save->p);
|
||||
players[i].overdrive = READUINT16(save->p);
|
||||
players[i].overshield = READUINT16(save->p);
|
||||
players[i].wavedashpower = READFIXED(save->p);
|
||||
players[i].overdrivepower = READFIXED(save->p);
|
||||
players[i].speedpunt = READUINT16(save->p);
|
||||
players[i].trickcharge = READUINT16(save->p);
|
||||
|
||||
|
|
@ -1231,6 +1241,10 @@ static void P_NetUnArchivePlayers(savebuffer_t *save)
|
|||
players[i].ringboxdelay = READUINT8(save->p);
|
||||
players[i].ringboxaward = READUINT8(save->p);
|
||||
|
||||
players[i].amps =READUINT8(save->p);
|
||||
players[i].amppickup =READUINT8(save->p);
|
||||
players[i].ampspending =READUINT8(save->p);
|
||||
|
||||
players[i].itemflags = READUINT8(save->p);
|
||||
|
||||
players[i].outrun = READFIXED(save->p);
|
||||
|
|
|
|||
|
|
@ -2048,6 +2048,7 @@ static void K_HandleLapIncrement(player_t *player)
|
|||
|
||||
K_SpawnDriftBoostExplosion(player, 4);
|
||||
K_SpawnDriftElectricSparks(player, SKINCOLOR_SILVER, false);
|
||||
K_SpawnAmps(player, 50, player->mo);
|
||||
|
||||
rainbowstartavailable = false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue