mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-12-17 13:32:38 +00:00
Juicebox gates forward port for SPB
This commit is contained in:
parent
3c26a2f19b
commit
dd94b1449e
16 changed files with 410 additions and 26 deletions
|
|
@ -426,6 +426,7 @@ typedef struct player_s
|
|||
fixed_t driftcharge; // Charge your drift so you can release a burst of speed
|
||||
UINT8 driftboost; // (0 to 125) - Boost you get from drifting
|
||||
UINT8 strongdriftboost; // (0 to 125) - While active, boost from drifting gives a stronger speed increase
|
||||
UINT16 gateBoost; // Juicebox Manta Ring boosts
|
||||
|
||||
SINT8 aizdriftstrat; // (-1 to 1) - Let go of your drift while boosting? Helper for the SICK STRATZ (sliptiding!) you have just unlocked
|
||||
INT32 aizdrifttilt;
|
||||
|
|
|
|||
|
|
@ -3651,6 +3651,10 @@ const char *const STATE_LIST[] = { // array length left dynamic for sanity testi
|
|||
"S_SPB20",
|
||||
"S_SPB_DEAD",
|
||||
|
||||
// Juicebox for SPB
|
||||
"S_MANTA1",
|
||||
"S_MANTA2",
|
||||
|
||||
// Lightning Shield
|
||||
"S_LIGHTNINGSHIELD1",
|
||||
"S_LIGHTNINGSHIELD2",
|
||||
|
|
@ -5353,6 +5357,7 @@ const char *const MOBJTYPE_LIST[] = { // array length left dynamic for sanity t
|
|||
|
||||
"MT_SPB", // Self-Propelled Bomb
|
||||
"MT_SPBEXPLOSION",
|
||||
"MT_MANTARING", // Juicebox for SPB
|
||||
|
||||
"MT_LIGHTNINGSHIELD", // Shields
|
||||
"MT_BUBBLESHIELD",
|
||||
|
|
|
|||
32
src/info.c
32
src/info.c
|
|
@ -565,6 +565,8 @@ char sprnames[NUMSPRITES + 1][5] =
|
|||
"BHOG", // Ballhog
|
||||
"BHBM", // Ballhog BOOM
|
||||
"SPBM", // Self-Propelled Bomb
|
||||
"TRIS", // SPB Manta Ring start
|
||||
"TRNQ", // SPB Manta Ring loop
|
||||
"THNS", // Lightning Shield
|
||||
"BUBS", // Bubble Shield (not Bubs)
|
||||
"BWVE", // Bubble Shield waves
|
||||
|
|
@ -4220,6 +4222,9 @@ state_t states[NUMSTATES] =
|
|||
{SPR_SPBM, 8, 1, {NULL}, 0, 0, S_SPB1}, // S_SPB20
|
||||
{SPR_SPBM, 8, 175, {NULL}, 0, 0, S_NULL}, // S_SPB_DEAD
|
||||
|
||||
{SPR_TRIS, FF_FULLBRIGHT|FF_ANIMATE|FF_PAPERSPRITE|FF_TRANS20|FF_ADD, 9, {NULL}, 2, 3, S_MANTA2}, // S_MANTA1
|
||||
{SPR_TRNQ, FF_FULLBRIGHT|FF_ANIMATE|FF_PAPERSPRITE|FF_TRANS20|FF_ADD, -1, {NULL}, 11, 3, S_NULL}, // S_MANTA2
|
||||
|
||||
{SPR_THNS, FF_FULLBRIGHT|9, 2, {NULL}, 0, 0, S_LIGHTNINGSHIELD2}, // S_LIGHTNINGSHIELD1
|
||||
{SPR_THNS, FF_FULLBRIGHT|10, 2, {NULL}, 0, 0, S_LIGHTNINGSHIELD3}, // S_LIGHTNINGSHIELD2
|
||||
{SPR_THNS, FF_FULLBRIGHT|11, 2, {NULL}, 0, 0, S_LIGHTNINGSHIELD4}, // S_LIGHTNINGSHIELD3
|
||||
|
|
@ -23903,6 +23908,33 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
S_NULL // raisestate
|
||||
},
|
||||
|
||||
{ // MT_MANTARING
|
||||
-1, // doomednum
|
||||
S_MANTA1, // spawnstate
|
||||
1000, // spawnhealth
|
||||
S_NULL, // seestate
|
||||
sfx_None, // seesound
|
||||
8, // 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
|
||||
64*FRACUNIT, // radius
|
||||
64*FRACUNIT, // height
|
||||
0, // display offset
|
||||
100, // mass
|
||||
0, // damage
|
||||
sfx_None, // activesound
|
||||
MF_NOGRAVITY|MF_NOCLIPHEIGHT|MF_DONTENCOREMAP, // flags
|
||||
S_NULL // raisestate
|
||||
},
|
||||
|
||||
{ // MT_LIGHTNINGSHIELD
|
||||
-1, // doomednum
|
||||
S_LIGHTNINGSHIELD1, // spawnstate
|
||||
|
|
|
|||
|
|
@ -1111,6 +1111,8 @@ typedef enum sprite
|
|||
SPR_BHOG, // Ballhog
|
||||
SPR_BHBM, // Ballhog BOOM
|
||||
SPR_SPBM, // Self-Propelled Bomb
|
||||
SPR_TRIS, // SPB Manta Ring start
|
||||
SPR_TRNQ, // SPB Manta Ring loop
|
||||
SPR_THNS, // Thunder Shield
|
||||
SPR_BUBS, // Bubble Shield (not Bubs)
|
||||
SPR_BWVE, // Bubble Shield waves
|
||||
|
|
@ -4647,6 +4649,10 @@ typedef enum state
|
|||
S_SPB20,
|
||||
S_SPB_DEAD,
|
||||
|
||||
// Juicebox for SPB
|
||||
S_MANTA1,
|
||||
S_MANTA2,
|
||||
|
||||
// Thunder Shield
|
||||
S_LIGHTNINGSHIELD1,
|
||||
S_LIGHTNINGSHIELD2,
|
||||
|
|
@ -6385,6 +6391,7 @@ typedef enum mobj_type
|
|||
|
||||
MT_SPB, // SPB stuff
|
||||
MT_SPBEXPLOSION,
|
||||
MT_MANTARING, // Juicebox for SPB
|
||||
|
||||
MT_LIGHTNINGSHIELD, // Shields
|
||||
MT_BUBBLESHIELD,
|
||||
|
|
|
|||
15
src/k_kart.c
15
src/k_kart.c
|
|
@ -3186,7 +3186,7 @@ static void K_GetKartBoostPower(player_t *player)
|
|||
|
||||
if (player->startboost) // Startup Boost
|
||||
{
|
||||
ADDBOOST(FRACUNIT, 4*FRACUNIT, sliptidehandling/2); // + 100% top speed, + 400% acceleration, +25% handling
|
||||
ADDBOOST(FRACUNIT, 4*FRACUNIT, sliptidehandling); // + 100% top speed, + 400% acceleration, +50% handling
|
||||
}
|
||||
|
||||
if (player->driftboost) // Drift Boost
|
||||
|
|
@ -3214,9 +3214,14 @@ static void K_GetKartBoostPower(player_t *player)
|
|||
ADDBOOST(player->trickboostpower, 5*FRACUNIT, 0); // <trickboostpower>% speed, 500% accel, 0% handling
|
||||
}
|
||||
|
||||
if (player->gateBoost) // SPB Juicebox boost
|
||||
{
|
||||
ADDBOOST(FRACUNIT/2, 4*FRACUNIT, sliptidehandling); // + 50% top speed, + 400% acceleration, +50% handling
|
||||
}
|
||||
|
||||
if (player->ringboost) // Ring Boost
|
||||
{
|
||||
ADDBOOST(FRACUNIT/5, 4*FRACUNIT, 0); // + 20% top speed, + 400% acceleration, +0% handling
|
||||
ADDBOOST(FRACUNIT/4, 4*FRACUNIT, 0); // + 20% top speed, + 400% acceleration, +0% handling
|
||||
}
|
||||
|
||||
if (player->eggmanexplode) // Ready-to-explode
|
||||
|
|
@ -7329,7 +7334,8 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
|
|||
// Speed lines
|
||||
if (player->sneakertimer || player->ringboost
|
||||
|| player->driftboost || player->startboost
|
||||
|| player->eggmanexplode || player->trickboost)
|
||||
|| player->eggmanexplode || player->trickboost
|
||||
|| player->gateBoost)
|
||||
{
|
||||
#if 0
|
||||
if (player->invincibilitytimer)
|
||||
|
|
@ -7579,6 +7585,9 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
|
|||
if (player->strongdriftboost)
|
||||
player->strongdriftboost--;
|
||||
|
||||
if (player->gateBoost)
|
||||
player->gateBoost--;
|
||||
|
||||
if (player->startboost > 0 && onground == true)
|
||||
{
|
||||
player->startboost--;
|
||||
|
|
|
|||
|
|
@ -23,4 +23,8 @@ fixed_t Obj_ItemDebrisBounce(mobj_t *debris, fixed_t momz);
|
|||
/* SPB */
|
||||
void Obj_SPBThink(mobj_t *spb);
|
||||
|
||||
/* SPB Juicebox Rings */
|
||||
void Obj_MantaRingThink(mobj_t *manta);
|
||||
mobj_t *Obj_MantaRingCreate(mobj_t *spb, mobj_t *owner, mobj_t *chase);
|
||||
|
||||
#endif/*k_objects_H*/
|
||||
|
|
|
|||
|
|
@ -151,6 +151,7 @@ void K_DoIngameRespawn(player_t *player)
|
|||
|
||||
player->ringboost = 0;
|
||||
player->driftboost = player->strongdriftboost = 0;
|
||||
player->gateBoost = 0;
|
||||
|
||||
K_TumbleInterrupt(player);
|
||||
P_ResetPlayer(player);
|
||||
|
|
|
|||
|
|
@ -250,6 +250,8 @@ static int player_get(lua_State *L)
|
|||
lua_pushinteger(L, plr->driftboost);
|
||||
else if (fastcmp(field,"strongdriftboost"))
|
||||
lua_pushinteger(L, plr->strongdriftboost);
|
||||
else if (fastcmp(field,"gateBoost"))
|
||||
lua_pushinteger(L, plr->gateBoost);
|
||||
else if (fastcmp(field,"aizdriftstraft"))
|
||||
lua_pushinteger(L, plr->aizdriftstrat);
|
||||
else if (fastcmp(field,"aizdrifttilt"))
|
||||
|
|
@ -612,6 +614,10 @@ static int player_set(lua_State *L)
|
|||
plr->driftcharge = luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"driftboost"))
|
||||
plr->driftboost = luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"strongdriftboost"))
|
||||
plr->strongdriftboost = luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"gateBoost"))
|
||||
plr->gateBoost = luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"aizdriftstraft"))
|
||||
plr->aizdriftstrat = luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"aizdrifttilt"))
|
||||
|
|
|
|||
|
|
@ -2,3 +2,4 @@ hyudoro.c
|
|||
shrink.c
|
||||
item-debris.c
|
||||
spb.c
|
||||
manta-ring.c
|
||||
|
|
|
|||
281
src/objects/manta-ring.c
Normal file
281
src/objects/manta-ring.c
Normal file
|
|
@ -0,0 +1,281 @@
|
|||
// DR. ROBOTNIK'S RING RACERS
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 2022 by Sally "TehRealSalt" Cochenour
|
||||
// Copyright (C) 2022 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 manta-ring.c
|
||||
/// \brief SPB Juicebox rings. See spb.c for their spawning.
|
||||
|
||||
#include "../doomdef.h"
|
||||
#include "../doomstat.h"
|
||||
#include "../info.h"
|
||||
#include "../k_kart.h"
|
||||
#include "../k_objects.h"
|
||||
#include "../m_random.h"
|
||||
#include "../p_local.h"
|
||||
#include "../r_main.h"
|
||||
#include "../s_sound.h"
|
||||
#include "../g_game.h"
|
||||
#include "../z_zone.h"
|
||||
#include "../k_waypoint.h"
|
||||
#include "../k_respawn.h"
|
||||
|
||||
#define MANTA_RACETIME (90)
|
||||
#define MANTA_MINTIME (15)
|
||||
#define MANTA_SPRINTTIME (60)
|
||||
|
||||
#define MANTA_ALIVEGATE (FF_TRANS40)
|
||||
#define MANTA_DEADGATE (FF_TRANS80)
|
||||
|
||||
#define MANTA_SIZE (2 * FRACUNIT)
|
||||
#define MANTA_SIZEUP (10)
|
||||
#define MANTA_SIZESTRENGTH (1500)
|
||||
#define MANTA_MAXRAMP (80)
|
||||
|
||||
#define MANTA_COLLIDE (80 * FRACUNIT)
|
||||
|
||||
#define MANTA_TURBO (40)
|
||||
#define MANTA_FASTRAMP (17)
|
||||
#define MANTA_MINPWR (10)
|
||||
|
||||
#define manta_delay(o) ((o)->fuse)
|
||||
#define manta_timealive(o) ((o)->movecount)
|
||||
#define manta_boostval(o) ((o)->extravalue1)
|
||||
#define manta_laps(o) ((o)->extravalue2)
|
||||
#define manta_touched(o) ((o)->cusval)
|
||||
|
||||
#define manta_owner(o) ((o)->target)
|
||||
#define manta_chase(o) ((o)->tracer)
|
||||
|
||||
static boolean MantaAlreadyTouched(mobj_t *manta, player_t *player)
|
||||
{
|
||||
INT32 touchFlag = 0;
|
||||
|
||||
if (manta_chase(manta) != NULL && P_MobjWasRemoved(manta_chase(manta)) == false
|
||||
&& player->mo == manta_chase(manta))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
#if 0
|
||||
if (manta_laps(manta) < player->laps)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
touchFlag = 1 << (player - players);
|
||||
return (manta_touched(manta) & touchFlag);
|
||||
}
|
||||
|
||||
static void Obj_MantaCollide(mobj_t *manta, mobj_t *other)
|
||||
{
|
||||
// Could hook this into actual mobj collide if desired.
|
||||
fixed_t distance = INT32_MAX;
|
||||
fixed_t size = INT32_MAX;
|
||||
|
||||
INT32 addBoost = 0;
|
||||
INT32 touchFlag = 0;
|
||||
|
||||
distance = P_AproxDistance(P_AproxDistance(
|
||||
other->x - manta->x,
|
||||
other->y - manta->y),
|
||||
other->z - manta->z) - other->radius - manta->radius;
|
||||
|
||||
size = FixedMul(MANTA_COLLIDE, mapobjectscale);
|
||||
|
||||
if (distance > size)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (other->player != NULL) // Just in case other objects should be added?
|
||||
{
|
||||
if (MantaAlreadyTouched(manta, other->player))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
touchFlag = 1 << (other->player - players);
|
||||
}
|
||||
|
||||
addBoost = manta_boostval(manta);
|
||||
|
||||
if (manta_timealive(manta) < MANTA_FASTRAMP)
|
||||
{
|
||||
// Ramp up to max power.
|
||||
addBoost = FixedMul(addBoost * FRACUNIT, (manta_timealive(manta) * FRACUNIT) / MANTA_FASTRAMP);
|
||||
|
||||
// Convert to integer
|
||||
addBoost = (addBoost + (FRACUNIT/2)) / FRACUNIT;
|
||||
|
||||
// Cap it
|
||||
addBoost = max(MANTA_MINPWR, addBoost);
|
||||
}
|
||||
|
||||
S_StartSound(other, sfx_gatefx);
|
||||
|
||||
if (other->player != NULL)
|
||||
{
|
||||
other->player->gateBoost += addBoost;
|
||||
|
||||
if (P_IsDisplayPlayer(other->player) == true)
|
||||
{
|
||||
P_StartQuake(12 << FRACBITS, 6);
|
||||
}
|
||||
}
|
||||
|
||||
if (touchFlag > 0)
|
||||
{
|
||||
manta_touched(manta) |= touchFlag;
|
||||
}
|
||||
}
|
||||
|
||||
static void RunMantaCollide(mobj_t *manta)
|
||||
{
|
||||
INT32 i;
|
||||
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
player_t *player = NULL;
|
||||
|
||||
if (playeringame[i] == false)
|
||||
{
|
||||
// Invalid
|
||||
continue;
|
||||
}
|
||||
|
||||
player = &players[i];
|
||||
if (player->spectator == true)
|
||||
{
|
||||
// Not playing.
|
||||
continue;
|
||||
}
|
||||
|
||||
if (player->mo == NULL || P_MobjWasRemoved(player->mo) == true)
|
||||
{
|
||||
// Invalid object
|
||||
continue;
|
||||
}
|
||||
|
||||
if (player->mo == manta_chase(manta))
|
||||
{
|
||||
// Don't allow the person being chased to touch this.
|
||||
continue;
|
||||
}
|
||||
|
||||
Obj_MantaCollide(manta, player->mo);
|
||||
}
|
||||
}
|
||||
|
||||
static void RunMantaVisual(mobj_t *manta)
|
||||
{
|
||||
INT32 i;
|
||||
|
||||
if (manta->fuse < 5*TICRATE)
|
||||
{
|
||||
if (leveltime & 1)
|
||||
{
|
||||
manta->renderflags |= RF_DONTDRAW;
|
||||
}
|
||||
else
|
||||
{
|
||||
manta->renderflags &= ~RF_DONTDRAW;
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i <= r_splitscreen; i++)
|
||||
{
|
||||
const UINT8 pID = displayplayers[i];
|
||||
player_t *player = &players[pID];
|
||||
|
||||
if (MantaAlreadyTouched(manta, player) == false)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (i > r_splitscreen)
|
||||
{
|
||||
manta->frame = (manta->frame & ~FF_TRANSMASK) | MANTA_DEADGATE;
|
||||
}
|
||||
else
|
||||
{
|
||||
manta->frame = (manta->frame & ~FF_TRANSMASK) | MANTA_ALIVEGATE;
|
||||
}
|
||||
}
|
||||
|
||||
void Obj_MantaRingThink(mobj_t *manta)
|
||||
{
|
||||
RunMantaVisual(manta);
|
||||
|
||||
if (manta_delay(manta) % MANTA_SIZEUP == 0)
|
||||
{
|
||||
manta->destscale += FixedMul(MANTA_SIZESTRENGTH, mapobjectscale);
|
||||
manta_boostval(manta) = min(MANTA_MAXRAMP, manta_boostval(manta) + 1);
|
||||
}
|
||||
|
||||
manta_timealive(manta)++;
|
||||
|
||||
RunMantaCollide(manta);
|
||||
}
|
||||
|
||||
mobj_t *Obj_MantaRingCreate(mobj_t *spb, mobj_t *owner, mobj_t *chase)
|
||||
{
|
||||
mobj_t *manta = NULL;
|
||||
INT32 delay = 0;
|
||||
|
||||
manta = P_SpawnMobjFromMobj(spb, 0, 0, 0, MT_MANTARING);
|
||||
|
||||
manta->color = SKINCOLOR_KETCHUP;
|
||||
|
||||
manta->destscale = FixedMul(MANTA_SIZE, spb->scale);
|
||||
P_SetScale(manta, manta->destscale);
|
||||
|
||||
manta->angle = R_PointToAngle2(0, 0, spb->momx, spb->momy) + ANGLE_90;
|
||||
|
||||
// Set boost value
|
||||
manta_boostval(manta) = MANTA_TURBO;
|
||||
|
||||
// Set despawn delay
|
||||
delay = max(MANTA_MINTIME, MANTA_RACETIME / mapheaderinfo[gamemap - 1]->numlaps);
|
||||
|
||||
if (mapheaderinfo[gamemap - 1]->levelflags & LF_SECTIONRACE)
|
||||
{
|
||||
delay = MANTA_SPRINTTIME;
|
||||
}
|
||||
|
||||
manta_delay(manta) = delay * TICRATE;
|
||||
|
||||
// Default if neither object exists
|
||||
manta_laps(manta) = INT32_MAX;
|
||||
|
||||
// Set owner
|
||||
if (owner != NULL && P_MobjWasRemoved(owner) == false)
|
||||
{
|
||||
P_SetTarget(&manta_owner(manta), owner);
|
||||
|
||||
if (owner->player != NULL)
|
||||
{
|
||||
// Default if chaser doesn't exist
|
||||
manta_laps(manta) = owner->player->laps;
|
||||
}
|
||||
}
|
||||
|
||||
// Set chaser
|
||||
if (chase != NULL && P_MobjWasRemoved(chase) == false)
|
||||
{
|
||||
P_SetTarget(&manta_chase(manta), chase);
|
||||
|
||||
if (chase->player != NULL)
|
||||
{
|
||||
manta_laps(manta) = chase->player->laps;
|
||||
}
|
||||
}
|
||||
|
||||
return manta;
|
||||
}
|
||||
|
|
@ -24,13 +24,19 @@
|
|||
#include "../k_waypoint.h"
|
||||
#include "../k_respawn.h"
|
||||
|
||||
//#define SPB_SEEKTEST
|
||||
#define SPB_SEEKTEST
|
||||
|
||||
#define SPB_SLIPTIDEDELTA (ANG1 * 3)
|
||||
#define SPB_STEERDELTA (ANGLE_90 - ANG10)
|
||||
#define SPB_DEFAULTSPEED (FixedMul(mapobjectscale, K_GetKartSpeedFromStat(9) * 2))
|
||||
#define SPB_ACTIVEDIST (1024 * FRACUNIT)
|
||||
|
||||
#define SPB_MANTA_SPACING (2750 * FRACUNIT)
|
||||
|
||||
#define SPB_MANTA_VSTART (150)
|
||||
#define SPB_MANTA_VRATE (60)
|
||||
#define SPB_MANTA_VMAX (100)
|
||||
|
||||
enum
|
||||
{
|
||||
SPB_MODE_SEEK,
|
||||
|
|
@ -48,25 +54,44 @@ enum
|
|||
|
||||
#define spb_curwaypoint(o) ((o)->cusval)
|
||||
|
||||
#define spb_manta_vscale(o) ((o)->movecount)
|
||||
#define spb_manta_totaldist(o) ((o)->reactiontime)
|
||||
|
||||
#define spb_owner(o) ((o)->target)
|
||||
#define spb_chase(o) ((o)->tracer)
|
||||
|
||||
static void SpawnSPBTrailRings(mobj_t *spb)
|
||||
static void SPBMantaRings(mobj_t *spb)
|
||||
{
|
||||
if (leveltime % (spb_mode(spb) != SPB_MODE_SEEK ? 6 : 3) == 0)
|
||||
fixed_t vScale = INT32_MAX;
|
||||
fixed_t spacing = INT32_MAX;
|
||||
fixed_t finalDist = INT32_MAX;
|
||||
|
||||
if (leveltime % SPB_MANTA_VRATE == 0)
|
||||
{
|
||||
mobj_t *ring = P_SpawnMobjFromMobj(spb,
|
||||
-FixedDiv(spb->momx, spb->scale),
|
||||
-FixedDiv(spb->momy, spb->scale),
|
||||
-FixedDiv(spb->momz, spb->scale) + (24*FRACUNIT),
|
||||
MT_RING
|
||||
spb_manta_vscale(spb) = max(spb_manta_vscale(spb) - 1, SPB_MANTA_VMAX);
|
||||
}
|
||||
|
||||
spacing = FixedMul(SPB_MANTA_SPACING, spb->scale);
|
||||
spacing = FixedMul(spacing, K_GetKartGameSpeedScalar(gamespeed));
|
||||
|
||||
vScale = FixedDiv(spb_manta_vscale(spb) * FRACUNIT, 100 * FRACUNIT);
|
||||
finalDist = FixedMul(spacing, vScale);
|
||||
|
||||
spb_manta_totaldist(spb) += P_AproxDistance(spb->momx, spb->momy);
|
||||
|
||||
if (spb_manta_totaldist(spb) > finalDist)
|
||||
{
|
||||
spb_manta_totaldist(spb) = 0;
|
||||
|
||||
Obj_MantaRingCreate(
|
||||
spb,
|
||||
spb_owner(spb),
|
||||
#ifdef SPB_SEEKTEST
|
||||
NULL
|
||||
#else
|
||||
spb_chase(spb)
|
||||
#endif
|
||||
);
|
||||
|
||||
ring->threshold = 10;
|
||||
ring->fuse = 35*TICRATE;
|
||||
|
||||
ring->colorized = true;
|
||||
ring->color = SKINCOLOR_RED;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -291,6 +316,7 @@ static void SPBSeek(mobj_t *spb, player_t *bestPlayer)
|
|||
|
||||
#ifdef SPB_SEEKTEST // Easy debug switch
|
||||
(void)dist;
|
||||
(void)activeDist;
|
||||
#else
|
||||
if (dist <= activeDist)
|
||||
{
|
||||
|
|
@ -322,7 +348,6 @@ static void SPBSeek(mobj_t *spb, player_t *bestPlayer)
|
|||
fixed_t waypointDist = INT32_MAX;
|
||||
fixed_t waypointRad = INT32_MAX;
|
||||
|
||||
CONS_Printf("Moving towards waypoint... (%d)\n", K_GetWaypointID(curWaypoint));
|
||||
destX = curWaypoint->mobj->x;
|
||||
destY = curWaypoint->mobj->y;
|
||||
destZ = curWaypoint->mobj->z;
|
||||
|
|
@ -353,17 +378,14 @@ static void SPBSeek(mobj_t *spb, player_t *bestPlayer)
|
|||
if (pathtoplayer.numnodes > 1)
|
||||
{
|
||||
curWaypoint = (waypoint_t *)pathtoplayer.array[1].nodedata;
|
||||
CONS_Printf("NEW: Proper next waypoint (%d)\n", K_GetWaypointID(curWaypoint));
|
||||
}
|
||||
else if (destWaypoint->numnextwaypoints > 0)
|
||||
{
|
||||
curWaypoint = destWaypoint->nextwaypoints[0];
|
||||
CONS_Printf("NEW: Forcing next waypoint (%d)\n", K_GetWaypointID(curWaypoint));
|
||||
}
|
||||
else
|
||||
{
|
||||
curWaypoint = destWaypoint;
|
||||
CONS_Printf("NEW: Forcing destination (%d)\n", K_GetWaypointID(curWaypoint));
|
||||
}
|
||||
|
||||
Z_Free(pathtoplayer.array);
|
||||
|
|
@ -380,7 +402,6 @@ static void SPBSeek(mobj_t *spb, player_t *bestPlayer)
|
|||
}
|
||||
else
|
||||
{
|
||||
CONS_Printf("FAILURE, no waypoint (pathfind unsuccessful)\n");
|
||||
spb_curwaypoint(spb) = -1;
|
||||
destX = spb_chase(spb)->x;
|
||||
destY = spb_chase(spb)->y;
|
||||
|
|
@ -390,7 +411,6 @@ static void SPBSeek(mobj_t *spb, player_t *bestPlayer)
|
|||
}
|
||||
else
|
||||
{
|
||||
CONS_Printf("FAILURE, no waypoint (no initial waypoint)\n");
|
||||
spb_curwaypoint(spb) = -1;
|
||||
destX = spb_chase(spb)->x;
|
||||
destY = spb_chase(spb)->y;
|
||||
|
|
@ -462,7 +482,7 @@ static void SPBSeek(mobj_t *spb, player_t *bestPlayer)
|
|||
SpawnSPBSpeedLines(spb);
|
||||
|
||||
// Spawn a trail of rings behind the SPB!
|
||||
SpawnSPBTrailRings(spb);
|
||||
SPBMantaRings(spb);
|
||||
}
|
||||
|
||||
static void SPBChase(mobj_t *spb, player_t *bestPlayer)
|
||||
|
|
@ -613,7 +633,7 @@ static void SPBChase(mobj_t *spb, player_t *bestPlayer)
|
|||
spb->momy += cy;
|
||||
|
||||
// Spawn a trail of rings behind the SPB!
|
||||
SpawnSPBTrailRings(spb);
|
||||
SPBMantaRings(spb);
|
||||
|
||||
// Red speed lines for when it's gaining on its target. A tell for when you're starting to lose too much speed!
|
||||
if (R_PointToDist2(0, 0, spb->momx, spb->momy) > (16 * R_PointToDist2(0, 0, chase->momx, chase->momy)) / 15 // Going faster than the target
|
||||
|
|
@ -695,11 +715,14 @@ void Obj_SPBThink(mobj_t *spb)
|
|||
|
||||
if (spb_nothink(spb) > 0)
|
||||
{
|
||||
// Doesn't think yet, when it initially spawns.
|
||||
// Init values, don't think yet.
|
||||
spb_lastplayer(spb) = -1;
|
||||
spb_curwaypoint(spb) = -1;
|
||||
spbplace = -1;
|
||||
|
||||
spb_manta_totaldist(spb) = 0; // 30000?
|
||||
spb_manta_vscale(spb) = SPB_MANTA_VSTART;
|
||||
|
||||
P_InstaThrust(spb, spb->angle, SPB_DEFAULTSPEED);
|
||||
|
||||
spb_nothink(spb)--;
|
||||
|
|
|
|||
|
|
@ -2060,6 +2060,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
|||
|
||||
player->sneakertimer = player->numsneakers = 0;
|
||||
player->driftboost = player->strongdriftboost = 0;
|
||||
player->gateBoost = 0;
|
||||
player->ringboost = 0;
|
||||
player->glanceDir = 0;
|
||||
player->pflags &= ~PF_LOOKDOWN;
|
||||
|
|
|
|||
|
|
@ -6934,6 +6934,11 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
|
|||
Obj_SPBThink(mobj);
|
||||
break;
|
||||
}
|
||||
case MT_MANTARING:
|
||||
{
|
||||
Obj_MantaRingThink(mobj);
|
||||
break;
|
||||
}
|
||||
case MT_BALLHOG:
|
||||
{
|
||||
mobj_t *ghost = P_SpawnGhostMobj(mobj);
|
||||
|
|
|
|||
|
|
@ -261,6 +261,7 @@ static void P_NetArchivePlayers(void)
|
|||
WRITEFIXED(save_p, players[i].driftcharge);
|
||||
WRITEUINT8(save_p, players[i].driftboost);
|
||||
WRITEUINT8(save_p, players[i].strongdriftboost);
|
||||
WRITEUINT16(save_p, players[i].gateBoost);
|
||||
|
||||
WRITESINT8(save_p, players[i].aizdriftstrat);
|
||||
WRITEINT32(save_p, players[i].aizdrifttilt);
|
||||
|
|
@ -552,6 +553,7 @@ static void P_NetUnArchivePlayers(void)
|
|||
players[i].driftcharge = READFIXED(save_p);
|
||||
players[i].driftboost = READUINT8(save_p);
|
||||
players[i].strongdriftboost = READUINT8(save_p);
|
||||
players[i].gateBoost = READUINT16(save_p);
|
||||
|
||||
players[i].aizdriftstrat = READSINT8(save_p);
|
||||
players[i].aizdrifttilt = READINT32(save_p);
|
||||
|
|
|
|||
|
|
@ -1118,6 +1118,9 @@ sfxinfo_t S_sfx[NUMSFX] =
|
|||
// Shrink laser beam
|
||||
{"beam01", false, 32, 64, -1, NULL, 0, -1, -1, LUMPERROR, ""},
|
||||
|
||||
// Juicebox for SPB
|
||||
{"gatefx", false, 32, 64, -1, NULL, 0, -1, -1, LUMPERROR, ""},
|
||||
|
||||
// SRB2Kart - Engine sounds
|
||||
// Engine class A
|
||||
{"krta00", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR, ""},
|
||||
|
|
|
|||
|
|
@ -1183,6 +1183,9 @@ typedef enum
|
|||
// Shrink laser
|
||||
sfx_beam01,
|
||||
|
||||
// Juicebox for SPB
|
||||
sfx_gatefx,
|
||||
|
||||
// Next up: UNIQUE ENGINE SOUNDS! Hoooooo boy...
|
||||
// Engine class A - Low Speed, Low Weight
|
||||
sfx_krta00,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue