Merge branch 'master' into stair-janking

This commit is contained in:
Sally Coolatta 2021-04-21 21:44:23 -04:00
commit 48c8843feb
54 changed files with 2537 additions and 3959 deletions

View file

@ -1051,15 +1051,6 @@ static void SV_SendPlayerInfo(INT32 node)
// Extra data
netbuffer->u.playerinfo[i].data = 0; //players[i].skincolor;
if (players[i].pflags & PF_TAGIT)
netbuffer->u.playerinfo[i].data |= 0x20;
if (players[i].gotflag)
netbuffer->u.playerinfo[i].data |= 0x40;
if (players[i].powers[pw_super])
netbuffer->u.playerinfo[i].data |= 0x80;
}
HSendPacket(node, false, 0, sizeof(plrinfo) * MSCOMPAT_MAXPLAYERS);
@ -4790,7 +4781,7 @@ static INT16 Consistancy(void)
{
ret += players[i].mo->x;
ret -= players[i].mo->y;
ret += players[i].kartstuff[k_itemtype]; // powers[pw_shield]
ret += players[i].itemtype;
ret *= i+1;
}
}

View file

@ -1006,7 +1006,6 @@ void D_RegisterClientCommands(void)
// add cheat commands
COM_AddCommand("noclip", Command_CheatNoClip_f);
COM_AddCommand("god", Command_CheatGod_f);
COM_AddCommand("notarget", Command_CheatNoTarget_f);
COM_AddCommand("setrings", Command_Setrings_f);
COM_AddCommand("setlives", Command_Setlives_f);
COM_AddCommand("devmode", Command_Devmode_f);
@ -1418,7 +1417,7 @@ static void SendNameAndColor(UINT8 n)
player->skincolor = cv_playercolor[n].value;
if (player->mo && !player->powers[pw_dye])
if (player->mo && !player->dye)
player->mo->color = player->skincolor;
// Update follower for local games:
@ -1879,7 +1878,7 @@ static INT32 FindPlayerByPlace(INT32 place)
for (playernum = 0; playernum < MAXPLAYERS; ++playernum)
if (playeringame[playernum])
{
if (players[playernum].kartstuff[k_position] == place)
if (players[playernum].position == place)
{
return playernum;
}
@ -1903,7 +1902,7 @@ static void GetViewablePlayerPlaceRange(INT32 *first, INT32 *last)
for (i = 0; i < MAXPLAYERS; ++i)
if (G_CouldView(i))
{
place = players[i].kartstuff[k_position];
place = players[i].position;
if (place < (*first))
(*first) = place;
if (place > (*last))
@ -2974,7 +2973,7 @@ static void Command_Respawn(void)
}
// todo: this probably isnt necessary anymore with v2
if (players[consoleplayer].mo && (P_PlayerInPain(&players[consoleplayer]) || spbplace == players[consoleplayer].kartstuff[k_position])) // KART: Nice try, but no, you won't be cheesing spb anymore (x2)
if (players[consoleplayer].mo && (P_PlayerInPain(&players[consoleplayer]) || spbplace == players[consoleplayer].position)) // KART: Nice try, but no, you won't be cheesing spb anymore (x2)
{
CONS_Printf(M_GetText("Nice try.\n"));
return;
@ -2989,7 +2988,7 @@ static void Got_Respawn(UINT8 **cp, INT32 playernum)
INT32 respawnplayer = READINT32(*cp);
// You can't respawn someone else. Nice try, there.
if (respawnplayer != playernum || P_PlayerInPain(&players[respawnplayer]) || spbplace == players[respawnplayer].kartstuff[k_position]) // srb2kart: "|| (!(gametyperules & GTR_CIRCUIT))"
if (respawnplayer != playernum || P_PlayerInPain(&players[respawnplayer]) || spbplace == players[respawnplayer].position) // srb2kart: "|| (!(gametyperules & GTR_CIRCUIT))"
{
CONS_Alert(CONS_WARNING, M_GetText("Illegal respawn command received from %s\n"), player_names[playernum]);
if (server)
@ -3144,7 +3143,7 @@ static void HandleTeamChangeCommand(UINT8 localplayer)
if (players[g_localplayers[localplayer]].spectator)
error = !(NetPacket.packet.newteam || (players[g_localplayers[localplayer]].pflags & PF_WANTSTOJOIN)); // :lancer:
else if (G_GametypeHasTeams())
error = (NetPacket.packet.newteam == (unsigned)players[g_localplayers[localplayer]].ctfteam);
error = (NetPacket.packet.newteam == players[g_localplayers[localplayer]].ctfteam);
else if (G_GametypeHasSpectators() && !players[g_localplayers[localplayer]].spectator)
error = (NetPacket.packet.newteam == 3);
#ifdef PARANOIA
@ -3260,7 +3259,7 @@ static void Command_ServerTeamChange_f(void)
if (G_GametypeHasTeams())
{
if (NetPacket.packet.newteam == (unsigned)players[NetPacket.packet.playernum].ctfteam ||
if (NetPacket.packet.newteam == players[NetPacket.packet.playernum].ctfteam ||
(players[NetPacket.packet.playernum].spectator && !NetPacket.packet.newteam))
error = true;
}
@ -3437,7 +3436,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
displayplayers[0] = consoleplayer;
}
if (G_GametypeHasTeams())
/*if (G_GametypeHasTeams())
{
if (NetPacket.packet.newteam)
{
@ -3445,10 +3444,10 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
for (i = 0; i <= splitscreen; i++)
{
if (playernum == g_localplayers[i]) //CTF and Team Match colors.
CV_SetValue(&cv_playercolor[i], NetPacket.packet.newteam + 5);
CV_SetValue(&cv_playercolor[i], NetPacket.packet.newteam + 5); - -this calculation is totally wrong
}
}
}
}*/
if (gamestate != GS_LEVEL)
return;
@ -3460,7 +3459,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
{
if (gametyperules & GTR_BUMPERS) // SRB2kart
{
players[playernum].marescore = 0;
players[playernum].roundscore = 0;
K_CalculateBattleWanted();
}
@ -4861,8 +4860,6 @@ static void Got_GiveItemcmd(UINT8 **cp, INT32 playernum)
int item;
int amt;
INT32 *kartstuff;
item = READSINT8 (*cp);
amt = READUINT8 (*cp);
@ -4879,10 +4876,8 @@ static void Got_GiveItemcmd(UINT8 **cp, INT32 playernum)
return;
}
kartstuff = players[playernum].kartstuff;
kartstuff[k_itemtype] = item;
kartstuff[k_itemamount] = amt;
players[playernum].itemtype = item;
players[playernum].itemamount = amt;
}
/** Prints the number of displayplayers[0].

View file

@ -58,54 +58,48 @@ typedef enum
//
typedef enum
{
PF_FAULT = 1,
// Cheats
PF_GODMODE = 1<<4,
PF_NOCLIP = 1<<5,
PF_INVIS = 1<<6,
// True if button down last tic.
PF_ATTACKDOWN = 1<<7,
PF_ACCELDOWN = 1<<8,
PF_BRAKEDOWN = 1<<9,
PF_WPNDOWN = 1<<10, // unused
PF_ATTACKDOWN = 1,
PF_ACCELDOWN = 1<<1,
PF_BRAKEDOWN = 1<<2,
PF_WPNDOWN = 1<<3, // reserved - gonna turn this into lookback when i'm done with all the major reengineering
// Unmoving states
PF_STASIS = 1<<11, // Player is not allowed to move
PF_JUMPSTASIS = 1<<12, // unused
// Accessibility and cheats
PF_KICKSTARTACCEL = 1<<4, // Is accelerate in kickstart mode?
PF_GODMODE = 1<<5,
PF_NOCLIP = 1<<6,
// SRB2Kart: Spectator that wants to join
PF_WANTSTOJOIN = 1<<13,
PF_WANTSTOJOIN = 1<<7, // Spectator that wants to join
// Character action status
PF_STARTJUMP = 1<<14, // unused
PF_JUMPED = 1<<15, // unused
PF_NOJUMPDAMAGE = 1<<16, // unused
PF_SPINNING = 1<<17, // unused
PF_STARTDASH = 1<<18, // unused
PF_THOKKED = 1<<19, // unused
PF_SHIELDABILITY = 1<<20, // unused
PF_GLIDING = 1<<21, // unused
PF_BOUNCING = 1<<22, // unused
PF_STASIS = 1<<8, // Player is not allowed to move
PF_FAULT = 1<<9, // F A U L T
PF_ELIMINATED = 1<<10, // Battle-style elimination, no extra penalty
PF_NOCONTEST = 1<<11, // Did not finish (last place explosion)
PF_LOSTLIFE = 1<<12, // Do not lose life more than once
// Sliding (usually in water) like Labyrinth/Oil Ocean
PF_SLIDING = 1<<23,
PF_RINGLOCK = 1<<13, // Prevent picking up rings while SPB is locked on
// NiGHTS stuff
PF_TRANSFERTOCLOSEST = 1<<24, // unused
PF_DRILLING = 1<<25, // unused
// The following four flags are mutually exclusive, although they can also all be off at the same time. If we ever run out of pflags, eventually turn them into a seperate five(+) mode UINT8..?
PF_USERINGS = 1<<14, // Have to be not holding the item button to change from using rings to using items (or vice versa) - prevents weirdness
PF_ITEMOUT = 1<<15, // Are you holding an item out?
PF_EGGMANOUT = 1<<16, // Eggman mark held, separate from PF_ITEMOUT so it doesn't stop you from getting items
PF_HOLDREADY = 1<<17, // Hold button-style item is ready to activate
// Gametype-specific stuff
PF_GAMETYPEOVER = 1<<26, // Race time over
PF_TAGIT = 1<<27, // unused
PF_DRIFTINPUT = 1<<18, // Drifting!
PF_GETSPARKS = 1<<19, // Can get sparks
PF_DRIFTEND = 1<<20, // Drift has ended, used to adjust character angle after drift
PF_BRAKEDRIFT = 1<<21, // Helper for brake-drift spark spawning
/*** misc ***/
PF_KICKSTARTACCEL = 1<<28, // Accessibility feature - is accelerate in kickstart mode?
PF_CANCARRY = 1<<29, // unused
PF_HITFINISHLINE = 1<<30, // Already hit the finish line this tic
PF_AIRFAILSAFE = 1<<22, // Whenever or not try the air boost
PF_TRICKDELAY = 1<<23, // Prevent tricks until control stick is neutral
// up to 1<<31 is free, but try to hit unused stuff first
PF_TUMBLELASTBOUNCE = 1<<24, // One more time for the funny
PF_TUMBLESOUND = 1<<25, // Don't play more than once
PF_HITFINISHLINE = 1<<26, // Already hit the finish line this tic
PF_WRONGWAY = 1<<27, // Moving the wrong way with respect to waypoints?
// up to 1<<31 is free
} pflags_t;
typedef enum
@ -119,104 +113,13 @@ typedef enum
PA_HURT
} panim_t;
//
// All of the base srb2 shields are either a single constant,
// or use damagetype-protecting flags applied to a constant,
// or are the force shield (which does everything weirdly).
//
// Base flags by themselves aren't used so modders can make
// abstract, ability-less shields should they so choose.
//
typedef enum
{
SH_NONE = 0,
// Shield flags
SH_PROTECTFIRE = 0x400,
SH_PROTECTWATER = 0x800,
SH_PROTECTELECTRIC = 0x1000,
SH_PROTECTSPIKE = 0x2000, // cactus shield one day? thanks, subarashii
//SH_PROTECTNUKE = 0x4000, // intentionally no hardcoded defense against nukes
// Indivisible shields
SH_PITY = 1, // the world's most basic shield ever, given to players who suck at Match
SH_WHIRLWIND,
SH_ARMAGEDDON,
SH_PINK, // PITY IN PINK!
// Normal shields that use flags
SH_ATTRACT = SH_PITY|SH_PROTECTELECTRIC,
SH_ELEMENTAL = SH_PITY|SH_PROTECTFIRE|SH_PROTECTWATER,
// Sonic 3 shields
SH_FLAMEAURA = SH_PITY|SH_PROTECTFIRE,
SH_BUBBLEWRAP = SH_PITY|SH_PROTECTWATER,
SH_THUNDERCOIN = SH_WHIRLWIND|SH_PROTECTELECTRIC,
// The force shield uses the lower 8 bits to count how many extra hits are left.
SH_FORCE = 0x100,
SH_FORCEHP = 0xFF, // to be used as a bitmask only
// Mostly for use with Mario mode.
SH_FIREFLOWER = 0x200,
SH_STACK = SH_FIREFLOWER, // second-layer shields
SH_NOSTACK = ~SH_STACK
} shieldtype_t; // pw_shield
typedef enum
{
CR_NONE = 0,
// Specific level gimmicks.
CR_SLIDING,
CR_ZOOMTUBE,
} carrytype_t; // pw_carry
// Player powers. (don't edit this comment)
typedef enum
{
pw_invulnerability,
pw_sneakers,
pw_flashing,
pw_shield,
pw_carry,
pw_tailsfly, // tails flying
pw_underwater, // underwater timer
pw_spacetime, // In space, no one can hear you spin!
pw_extralife, // Extra Life timer
pw_pushing,
pw_justsprung,
pw_noautobrake,
pw_super, // Are you super?
pw_gravityboots, // gravity boots
// Weapon ammunition
pw_infinityring,
pw_automaticring,
pw_bouncering,
pw_scatterring,
pw_grenadering,
pw_explosionring,
pw_railring,
// Power Stones
pw_emeralds, // stored like global 'emeralds' variable
// NiGHTS powerups
pw_nights_superloop,
pw_nights_helper,
pw_nights_linkfreeze,
pw_nocontrol, //for linedef exec 427
pw_dye, // for dyes
pw_justlaunched, // Launched off a slope this tic (0=none, 1=standard launch, 2=half-pipe launch)
pw_ignorelatch, // Don't grab onto CR_GENERIC, add 32768 (powers[pw_ignorelatch] & 1<<15) to avoid ALL not-NiGHTS CR_ types
NUMPOWERS
} powertype_t;
} carrytype_t; // carry
/*
To use: #define FOREACH( name, number )
@ -295,110 +198,6 @@ typedef enum
#undef KSPIN_TYPE
} kartspinoutflags_t;
//{ SRB2kart - kartstuff
typedef enum
{
// TODO: Kill this giant array. Add them as actual player_t variables, or condense related timers into their own, smaller arrays.
// Basic gameplay things
k_position, // Used for Kart positions, mostly for deterministic stuff
k_oldposition, // Used for taunting when you pass someone
k_positiondelay, // Used for position number, so it can grow when passing/being passed
k_throwdir, // Held dir of controls; 1 = forward, 0 = none, -1 = backward (was "player->heldDir")
k_instashield, // Instashield no-damage animation timer
k_floorboost, // Prevents Sneaker sounds for a breif duration when triggered by a floor panel
k_spinouttype, // Determines the mode of spinout/wipeout, see kartspinoutflags_t
k_drift, // Drifting Left or Right, plus a bigger counter = sharper turn
k_driftend, // Drift has ended, used to adjust character angle after drift
k_driftcharge, // Charge your drift so you can release a burst of speed
k_driftboost, // Boost you get from drifting
k_boostcharge, // Charge-up for boosting at the start of the race
k_startboost, // Boost you get from start of race or respawn drop dash
k_rings, // Number of held rings
k_pickuprings, // Number of rings being picked up before added to the counter (prevents rings from being deleted forever over 20)
k_userings, // Have to be not holding the item button to change from using rings to using items (or vice versa), to prevent some weirdness with the button
k_ringdelay, // 3 tic delay between every ring usage
k_ringboost, // Ring boost timer
k_ringlock, // Prevent picking up rings while SPB is locked on
k_sparkleanim, // Angle offset for ring sparkle animation
k_jmp, // In Mario Kart, letting go of the jump button stops the drift
k_offroad, // In Super Mario Kart, going offroad has lee-way of about 1 second before you start losing speed
k_brakestop, // Wait until you've made a complete stop for a few tics before letting brake go in reverse.
k_spindash, // Spindash charge timer
k_spindashspeed, // Spindash release speed
k_spindashboost, // Spindash release boost timer
k_waterskip, // Water skipping counter
k_dashpadcooldown, // Separate the vanilla SA-style dash pads from using pw_flashing
k_numboosts, // Count of how many boosts are being stacked, for after image spawning
k_boostpower, // Base boost value, for offroad
k_speedboost, // Boost value smoothing for max speed
k_accelboost, // Boost value smoothing for acceleration
k_handleboost, // Boost value smoothing for handling
k_draftpower, // Drafting power (from 0 to FRACUNIT), doubles your top speed & acceleration at max
k_draftleeway, // Leniency timer before removing draft power
k_lastdraft, // Last player being drafted
k_boostangle, // angle set when not spun out OR boosted to determine what direction you should keep going at if you're spun out and boosted.
k_aizdriftstrat, // Let go of your drift while boosting? Helper for the SICK STRATZ you have just unlocked
k_brakedrift, // Helper for brake-drift spark spawning
k_itemroulette, // Used for the roulette when deciding what item to give you (was "pw_kartitem")
k_roulettetype, // Used for the roulette, for deciding type (currently only used for Battle, to give you better items from Karma items)
// Item held stuff
k_itemtype, // KITEM_ constant for item number
k_itemamount, // Amount of said item
k_itemheld, // Are you holding an item?
k_holdready, // Hold button-style item is ready to activate
// Some items use timers for their duration or effects
k_curshield, // 0 = no shield, 1 = thunder shield
k_hyudorotimer, // Duration of the Hyudoro offroad effect itself
k_stealingtimer, // You are stealing an item, this is your timer
k_stolentimer, // You are being stolen from, this is your timer
k_superring, // Spawn rings on top of you every tic!
k_sneakertimer, // Duration of a Sneaker Boost (from Sneakers or level boosters)
k_numsneakers, // Number of stacked sneaker effects
k_growshrinktimer, // > 0 = Big, < 0 = small
k_squishedtimer, // Squished frame timer
k_rocketsneakertimer, // Rocket Sneaker duration timer
k_invincibilitytimer, // Invincibility timer
k_bubblecool, // Bubble Shield use cooldown
k_bubbleblowup, // Bubble Shield usage blowup
k_flamedash, // Flame Shield dash power
k_flamemeter, // Flame Shield dash meter left
k_flamelength, // Flame Shield dash meter, number of segments
k_eggmanheld, // Eggman monitor held, separate from k_itemheld so it doesn't stop you from getting items
k_eggmanexplode, // Fake item recieved, explode in a few seconds
k_eggmanblame, // Fake item recieved, who set this fake
k_lastjawztarget, // Last person you target with jawz, for playing the target switch sfx
k_bananadrag, // After a second of holding a banana behind you, you start to slow down
k_spinouttimer, // Spin-out from a banana peel or oil slick (was "pw_bananacam")
k_wipeoutslow, // Timer before you slowdown when getting wiped out
k_justbumped, // Prevent players from endlessly bumping into each other
k_comebacktimer, // Battle mode, how long before you become a bomb after death
k_sadtimer, // How long you've been sad
// Battle Mode vars
k_bumper, // Number of bumpers left
k_comebackpoints, // Number of times you've bombed or gave an item to someone; once it's 3 it gets set back to 0 and you're given a bumper
k_comebackmode, // 0 = bomb, 1 = item
k_wanted, // Timer for determining WANTED status, lowers when hitting people, prevents the game turning into Camp Lazlo
// v1.0.2+ vars
k_getsparks, // Disable drift sparks at low speed, JUST enough to give acceleration the actual headstart above speed
k_jawztargetdelay, // Delay for Jawz target switching, to make it less twitchy
k_spectatewait, // How long have you been waiting as a spectator
k_tiregrease, // Reduced friction timer after hitting a horizontal spring
k_springstars, // Spawn stars around a player when they hit a spring
k_springcolor, // Color of spring stars
k_killfield, // How long have you been in the kill field, stay in too long and lose a bumper
k_wrongway, // Display WRONG WAY on screen
NUMKARTSTUFF
} kartstufftype_t;
typedef enum
{
// Unsynced, HUD or clientsided effects
@ -437,7 +236,7 @@ typedef enum
} karthudtype_t;
// QUICKLY GET RING TOTAL, INCLUDING RINGS CURRENTLY IN THE PICKUP ANIMATION
#define RINGTOTAL(p) (p->rings + p->kartstuff[k_pickuprings])
#define RINGTOTAL(p) (p->rings + p->pickuprings)
// CONSTANTS FOR TRICK PANELS
#define TRICKMOMZRAMP (30)
@ -453,7 +252,7 @@ typedef enum
// player_t struct for all respawn variables
typedef struct respawnvars_s
{
UINT8 state; // 0: not respawning, 1: heading towards respawn point, 2: about to drop
UINT8 state; // see RESPAWNST_ constants in k_respawn.h
waypoint_t *wp; // Waypoint that we're going towards, NULL if the position isn't linked to one
fixed_t pointx; // Respawn position coords to go towards
fixed_t pointy;
@ -475,6 +274,8 @@ typedef struct botvars_s
tic_t itemconfirm; // When high enough, they will use their item
SINT8 turnconfirm; // Confirm turn direction
tic_t spindashconfirm; // When high enough, they will try spindashing
} botvars_t;
// ========================================================================
@ -513,37 +314,6 @@ typedef struct player_s
// fun thing for player sprite
angle_t drawangle;
// player's ring count
INT16 rings;
INT16 spheres;
// Power ups. invinc and invis are tic counters.
UINT16 powers[NUMPOWERS];
// SRB2kart stuff
INT32 kartstuff[NUMKARTSTUFF];
INT32 karthud[NUMKARTHUD];
UINT32 distancetofinish;
waypoint_t *nextwaypoint;
respawnvars_t respawn; // Respawn info
tic_t airtime; // Keep track of how long you've been in the air
boolean driftInput; // Whenever or not try drifting.
boolean airFailsafe; // Whenever or not try the air boost
INT32 aizDriftTilt;
INT32 aizDriftTurn;
UINT8 trickpanel; // Trick panel state
boolean trickdelay; // Prevent tricks until control stick is neutral
fixed_t trickmomx;
fixed_t trickmomy;
fixed_t trickmomz; // Instead of stupid auxiliary variables let's... just make some ourselves.
UINT8 bumpers;
INT16 karmadelay;
boolean eliminated;
// Bit flags.
// See pflags_t, above.
pflags_t pflags;
@ -561,10 +331,6 @@ typedef struct player_s
INT32 skin;
UINT32 availabilities;
UINT32 score; // player score
fixed_t dashspeed; // dashing speed
// SRB2kart
UINT8 kartspeed; // Kart speed stat between 1 and 9
UINT8 kartweight; // Kart weight stat between 1 and 9
@ -573,44 +339,141 @@ typedef struct player_s
UINT16 followercolor; // Kart: Used to store the follower colour the player wishes to use
mobj_t *follower; // Kart: This is the follower object we have. (If any)
UINT8 tumbleBounces;
UINT16 tumbleHeight;
boolean tumbleLastBounce;
boolean tumbleSound;
SINT8 glanceDir; // Direction the player is trying to look backwards in
//
UINT32 charflags; // Extra abilities/settings for skins (combinable stuff)
// See SF_ flags
mobjtype_t followitem; // Object # to spawn for Smiles
mobj_t *followmobj; // Smiles all around
UINT32 score; // player score
UINT16 nocontrol; //for linedef exec 427
UINT8 carry;
UINT16 dye;
// SRB2kart stuff
INT32 karthud[NUMKARTHUD];
// Basic gameplay things
UINT8 position; // Used for Kart positions, mostly for deterministic stuff
UINT8 oldposition; // Used for taunting when you pass someone
UINT8 positiondelay; // Used for position number, so it can grow when passing/being passed
UINT32 distancetofinish;
waypoint_t *nextwaypoint;
respawnvars_t respawn; // Respawn info
tic_t airtime; // Keep track of how long you've been in the air
UINT8 startboost; // (0 to 125) - Boost you get from start of race or respawn drop dash
UINT16 flashing;
UINT16 spinouttimer; // Spin-out from a banana peel or oil slick (was "pw_bananacam")
UINT8 spinouttype; // Determines the mode of spinout/wipeout, see kartspinoutflags_t
UINT8 instashield; // Instashield no-damage animation timer
UINT8 wipeoutslow; // Timer before you slowdown when getting wiped out
UINT8 justbumped; // Prevent players from endlessly bumping into each other
UINT8 tumbleBounces;
UINT16 tumbleHeight;
SINT8 drift; // (-5 to 5) - Drifting Left or Right, plus a bigger counter = sharper turn
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
SINT8 aizdriftstrat; // (-1 to 1) - Let go of your drift while boosting? Helper for the SICK STRATZ (sliptiding!) you have just unlocked
INT32 aizdrifttilt;
INT32 aizdriftturn;
fixed_t offroad; // In Super Mario Kart, going offroad has lee-way of about 1 second before you start losing speed
UINT8 waterskip; // Water skipping counter
UINT16 tiregrease; // Reduced friction timer after hitting a horizontal spring
UINT16 springstars; // Spawn stars around a player when they hit a spring
UINT16 springcolor; // Color of spring stars
UINT8 dashpadcooldown; // Separate the vanilla SA-style dash pads from using flashing
UINT16 spindash; // Spindash charge timer
fixed_t spindashspeed; // Spindash release speed
UINT8 spindashboost; // Spindash release boost timer
UINT8 numboosts; // Count of how many boosts are being stacked, for after image spawning
fixed_t boostpower; // Base boost value, for offroad
fixed_t speedboost; // Boost value smoothing for max speed
fixed_t accelboost; // Boost value smoothing for acceleration
fixed_t handleboost; // Boost value smoothing for handling
angle_t boostangle; // angle set when not spun out OR boosted to determine what direction you should keep going at if you're spun out and boosted.
fixed_t draftpower; // (0 to FRACUNIT) - Drafting power, doubles your top speed & acceleration at max
UINT16 draftleeway; // Leniency timer before removing draft power
SINT8 lastdraft; // (-1 to 15) - Last player being drafted
UINT16 itemroulette; // Used for the roulette when deciding what item to give you (was "pw_kartitem")
UINT8 roulettetype; // Used for the roulette, for deciding type (0 = normal, 1 = better, 2 = eggman mark)
// Item held stuff
SINT8 itemtype; // KITEM_ constant for item number
UINT8 itemamount; // Amount of said item
SINT8 throwdir; // Held dir of controls; 1 = forward, 0 = none, -1 = backward (was "player->heldDir")
UINT8 sadtimer; // How long you've been sad
// player's ring count
SINT8 rings;
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
UINT8 sparkleanim; // (0 to 19) - Angle offset for ring sparkle animation
UINT8 superring; // Spawn rings on top of you every tic!
UINT8 curshield; // see kartshields_t
UINT8 bubblecool; // Bubble Shield use cooldown
UINT8 bubbleblowup; // Bubble Shield usage blowup
UINT16 flamedash; // Flame Shield dash power
UINT16 flamemeter; // Flame Shield dash meter left
UINT8 flamelength; // Flame Shield dash meter, number of segments
UINT16 hyudorotimer; // Duration of the Hyudoro offroad effect itself
SINT8 stealingtimer; // if >0 you are stealing, if <0 you are being stolen from
UINT16 sneakertimer; // Duration of a Sneaker Boost (from Sneakers or level boosters)
UINT8 numsneakers; // Number of stacked sneaker effects
UINT8 floorboost; // (0 to 3) - Prevents Sneaker sounds for a brief duration when triggered by a floor panel
INT16 growshrinktimer; // > 0 = Big, < 0 = small
UINT16 rocketsneakertimer; // Rocket Sneaker duration timer
UINT16 invincibilitytimer; // Invincibility timer
UINT8 eggmanexplode; // Fake item recieved, explode in a few seconds
SINT8 eggmanblame; // (-1 to 15) - Fake item recieved, who set this fake
UINT8 bananadrag; // After a second of holding a banana behind you, you start to slow down
SINT8 lastjawztarget; // (-1 to 15) - Last person you target with jawz, for playing the target switch sfx
UINT8 jawztargetdelay; // (0 to 5) - Delay for Jawz target switching, to make it less twitchy
UINT8 trickpanel; // Trick panel state
fixed_t trickmomx;
fixed_t trickmomy;
fixed_t trickmomz;
UINT32 roundscore; // battle score this round
UINT8 emeralds;
UINT8 bumpers;
INT16 karmadelay;
INT16 spheres;
SINT8 glanceDir; // Direction the player is trying to look backwards in
//
SINT8 lives;
boolean lostlife;
SINT8 continues; // continues that player has acquired
SINT8 xtralife; // Ring Extra Life counter
UINT8 gotcontinue; // Got continue from this stage?
fixed_t speed; // Player's speed (distance formula of MOMX and MOMY values)
fixed_t lastspeed;
UINT8 secondjump; // Jump counter
UINT8 fly1; // Tails flying
UINT8 scoreadd; // Used for multiple enemy attack bonus
tic_t glidetime; // Glide counter for thrust
UINT8 climbing; // Climbing on the wall
INT32 deadtimer; // End game if game over lasts too long
tic_t exiting; // Exitlevel timer
UINT8 homing; // Are you homing?
tic_t dashmode; // counter for dashmode ability
tic_t skidtime; // Skid timer
////////////////////////////
// Conveyor Belt Movement //
////////////////////////////
@ -619,73 +482,18 @@ typedef struct player_s
fixed_t rmomx; // "Real" momx (momx - cmomx)
fixed_t rmomy; // "Real" momy (momy - cmomy)
/////////////////////
// Race Mode Stuff //
/////////////////////
INT16 numboxes; // Number of item boxes obtained for Race Mode
INT16 totalring; // Total number of rings obtained for Race Mode
INT16 totalring; // Total number of rings obtained for GP
tic_t realtime; // integer replacement for leveltime
UINT8 laps; // Number of laps (optional)
INT32 starpostnum; // The number of the last starpost you hit
////////////////////
// CTF Mode Stuff //
////////////////////
INT32 ctfteam; // 0 == Spectator, 1 == Red, 2 == Blue
UINT16 gotflag; // 1 == Red, 2 == Blue Do you have the flag?
UINT8 ctfteam; // 0 == Spectator, 1 == Red, 2 == Blue
INT32 weapondelay; // Delay (if any) to fire the weapon again
INT32 tossdelay; // Delay (if any) to toss a flag/emeralds again
/////////////////
// NiGHTS Stuff//
/////////////////
angle_t angle_pos;
angle_t old_angle_pos;
mobj_t *axis1;
mobj_t *axis2;
tic_t bumpertime; // Currently being bounced by MT_NIGHTSBUMPER
INT32 flyangle;
tic_t drilltimer;
INT32 linkcount;
tic_t linktimer;
INT32 anotherflyangle;
tic_t nightstime; // How long you can fly as NiGHTS.
INT32 drillmeter;
UINT8 drilldelay;
boolean bonustime; // Capsule destroyed, now it's bonus time!
mobj_t *capsule; // Go inside the capsule
mobj_t *drone; // Move center to the drone
fixed_t oldscale; // Pre-Nightserize scale
UINT8 mare; // Current mare
UINT8 marelap; // Current mare lap
UINT8 marebonuslap; // Current mare lap starting from bonus time
// Statistical purposes.
tic_t marebegunat; // Leveltime when mare begun
tic_t startedtime; // Time which you started this mare with.
tic_t finishedtime; // Time it took you to finish the mare (used for display)
tic_t lapbegunat; // Leveltime when lap begun
tic_t lapstartedtime; // Time which you started this lap with.
INT16 finishedspheres; // The spheres you had left upon finishing the mare
INT16 finishedrings; // The rings/stars you had left upon finishing the mare
UINT32 marescore; // score for this nights stage
UINT32 lastmarescore; // score for the last mare
UINT32 totalmarescore; // score for all mares
UINT8 lastmare; // previous mare
UINT8 lastmarelap; // previous mare lap
UINT8 lastmarebonuslap; // previous mare bonus lap
UINT8 totalmarelap; // total mare lap
UINT8 totalmarebonuslap; // total mare bonus lap
INT32 maxlink; // maximum link obtained
UINT8 texttimer; // nights_texttime should not be local
UINT8 textvar; // which line of NiGHTS text to show -- let's not use cheap hacks
UINT8 checkskip; // Skipping checkpoints? Oh no no no
INT16 lastsidehit, lastlinehit;
tic_t losstime;
UINT8 timeshit; // That's TIMES HIT, not TIME SHIT, you doofus!
//UINT8 timeshit; // That's TIMES HIT, not TIME SHIT, you doofus! -- in memoriam
INT32 onconveyor; // You are on a conveyor belt if nonzero
@ -694,6 +502,7 @@ typedef struct player_s
angle_t awayviewaiming; // Used for cut-away view
boolean spectator;
tic_t spectatewait; // reimplementable as UINT8 queue - How long have you been waiting as a spectator
boolean bot;
botvars_t botvars;
@ -715,10 +524,6 @@ typedef struct player_s
#endif
} player_t;
// Values for dashmode
#define DASHMODE_THRESHOLD (3*TICRATE)
#define DASHMODE_MAX (DASHMODE_THRESHOLD + 3)
// Value for infinite lives
#define INFLIVES 0x7F

View file

@ -445,42 +445,6 @@ static inline int lib_getenum(lua_State *L)
return 1;
}
#endif
else if (!mathlib && fastncmp("pw_",word,3)) {
p = word+3;
for (i = 0; i < NUMPOWERS; i++)
if (fasticmp(p, POWERS_LIST[i])) {
lua_pushinteger(L, i);
return 1;
}
return 0;
}
else if (mathlib && fastncmp("PW_",word,3)) { // SOCs are ALL CAPS!
p = word+3;
for (i = 0; i < NUMPOWERS; i++)
if (fastcmp(p, POWERS_LIST[i])) {
lua_pushinteger(L, i);
return 1;
}
return luaL_error(L, "power '%s' could not be found.\n", word);
}
else if (!mathlib && fastncmp("k_",word,2)) {
p = word+2;
for (i = 0; i < NUMKARTSTUFF; i++)
if (fasticmp(p, KARTSTUFF_LIST[i])) {
lua_pushinteger(L, i);
return 1;
}
return 0;
}
else if (mathlib && fastncmp("K_",word,2)) { // SOCs are ALL CAPS!
p = word+2;
for (i = 0; i < NUMKARTSTUFF; i++)
if (fastcmp(p, KARTSTUFF_LIST[i])) {
lua_pushinteger(L, i);
return 1;
}
return luaL_error(L, "kartstuff '%s' could not be found.\n", word);
}
else if (!mathlib && fastncmp("khud_",word,5)) {
p = word+5;
for (i = 0; i < NUMKARTHUD; i++)

View file

@ -3556,10 +3556,6 @@ void readmaincfg(MYFILE *f)
{
maxXtraLife = (UINT8)get_number(word2);
}
else if (fastcmp(word, "USECONTINUES"))
{
useContinues = (UINT8)(value || word2[0] == 'T' || word2[0] == 'Y');
}
else if (fastcmp(word, "GAMEDATA"))
{
@ -4337,20 +4333,6 @@ menutype_t get_menutype(const char *word)
return i;
deh_warning("Couldn't find gametype named 'GT_%s'",word);
return GT_COOP;
}
static powertype_t get_power(const char *word)
{ // Returns the value of pw_ enumerations
powertype_t i;
if (*word >= '0' && *word <= '9')
return atoi(word);
if (fastncmp("PW_",word,3))
word += 3; // take off the pw_
for (i = 0; i < NUMPOWERS; i++)
if (fastcmp(word, POWERS_LIST[i]))
return i;
deh_warning("Couldn't find power named 'pw_%s'",word);
return pw_invulnerability;
}*/
/// \todo Make ANY of this completely over-the-top math craziness obey the order of operations.

View file

@ -85,18 +85,13 @@ actionpointer_t actionpointers[] =
{{A_FaceTracer}, "A_FACETRACER"},
{{A_Scream}, "A_SCREAM"},
{{A_BossDeath}, "A_BOSSDEATH"},
{{A_CustomPower}, "A_CUSTOMPOWER"},
{{A_RingBox}, "A_RINGBOX"},
{{A_Invincibility}, "A_INVINCIBILITY"},
{{A_SuperSneakers}, "A_SUPERSNEAKERS"},
{{A_BunnyHop}, "A_BUNNYHOP"},
{{A_BubbleSpawn}, "A_BUBBLESPAWN"},
{{A_FanBubbleSpawn}, "A_FANBUBBLESPAWN"},
{{A_BubbleRise}, "A_BUBBLERISE"},
{{A_BubbleCheck}, "A_BUBBLECHECK"},
{{A_AwardScore}, "A_AWARDSCORE"},
{{A_GiveShield}, "A_GIVESHIELD"},
{{A_GravityBox}, "A_GRAVITYBOX"},
{{A_ScoreRise}, "A_SCORERISE"},
{{A_AttractChase}, "A_ATTRACTCHASE"},
{{A_DropMine}, "A_DROPMINE"},
@ -3527,6 +3522,10 @@ const char *const STATE_LIST[] = { // array length left dynamic for sanity testi
"S_DRIFTWARNSPARK3",
"S_DRIFTWARNSPARK4",
// Drift electricity
"S_DRIFTELECTRICITY",
"S_DRIFTELECTRICSPARK",
// Fast lines
"S_FASTLINE1",
"S_FASTLINE2",
@ -5457,6 +5456,8 @@ const char *const MOBJTYPE_LIST[] = { // array length left dynamic for sanity t
"MT_DRIFTSPARK",
"MT_BRAKEDRIFT",
"MT_DRIFTDUST",
"MT_DRIFTELECTRICITY",
"MT_DRIFTELECTRICSPARK",
"MT_JANKSPARK",
"MT_ROCKETSNEAKER", // Rocket sneakers
@ -5835,56 +5836,46 @@ const char *const MAPTHINGFLAG_LIST[4] = {
};
const char *const PLAYERFLAG_LIST[] = {
"FAULT",
"ANALOGMODE", // Analog mode?
"DIRECTIONCHAR", // Directional character sprites?
"AUTOBRAKE", // Autobrake?
// Cheats
"GODMODE",
"NOCLIP",
"INVIS",
// True if button down last tic.
"ATTACKDOWN",
"ACCELDOWN",
"BRAKEDOWN",
"WPNDOWN",
"WPNDOWN", // reserved - gonna turn this into lookback when i'm done with all the major reengineering
// Accessibility and cheats
"KICKSTARTACCEL", // Is accelerate in kickstart mode?
"GODMODE",
"NOCLIP",
"WANTSTOJOIN", // Spectator that wants to join
// Unmoving states
"STASIS", // Player is not allowed to move
"JUMPSTASIS", // and that includes jumping.
"FAULT", // F A U L T
"ELIMINATED", // Battle-style elimination, no extra penalty
"NOCONTEST", // Did not finish (last place explosion)
"LOSTLIFE", // Do not lose life more than once
// SRB2Kart: spectator that wants to join
"WANTSTOJOIN",
"RINGLOCK", // Prevent picking up rings while SPB is locked on
// Character action status
"STARTJUMP",
"JUMPED",
"NOJUMPDAMAGE",
"SPINNING",
"STARTDASH",
"THOKKED",
"SHIELDABILITY",
"GLIDING",
"BOUNCING",
// The following four flags are mutually exclusive, although they can also all be off at the same time. If we ever run out of pflags, eventually turn them into a seperate five(+) mode UINT8..?
"USERINGS", // Have to be not holding the item button to change from using rings to using items (or vice versa) - prevents weirdness
"ITEMOUT", // Are you holding an item out?
"EGGMANOUT", // Eggman mark held, separate from PF_ITEMOUT so it doesn't stop you from getting items
"HOLDREADY", // Hold button-style item is ready to activate
// Sliding (usually in water) like Labyrinth/Oil Ocean
"SLIDING",
"DRIFTINPUT", // Drifting!
"GETSPARKS", // Can get sparks
"DRIFTEND", // Drift has ended, used to adjust character angle after drift
"BRAKEDRIFT", // Helper for brake-drift spark spawning
// NiGHTS stuff
"TRANSFERTOCLOSEST",
"DRILLING",
"AIRFAILSAFE", // Whenever or not try the air boost
"TRICKDELAY", // Prevent tricks until control stick is neutral
// Gametype-specific stuff
"GAMETYPEOVER", // Race time over
"TAGIT",
"TUMBLELASTBOUNCE", // One more time for the funny
"TUMBLESOUND", // Don't play more than once
/*** misc ***/
"FORCESTRAFE", // Accessibility feature - is accelerate in kickstart mode?
"CANCARRY",
"HITFINISHLINE", // Already hit the finish line this tic
"WRONGWAY", // Moving the wrong way with respect to waypoints?
NULL // stop loop here.
};
@ -6112,145 +6103,6 @@ const char *COLOR_ENUMS[] = {
"CHAOSEMERALD7"
};
const char *const POWERS_LIST[] = {
"INVULNERABILITY",
"SNEAKERS",
"FLASHING",
"SHIELD",
"CARRY",
"TAILSFLY", // tails flying
"UNDERWATER", // underwater timer
"SPACETIME", // In space, no one can hear you spin!
"EXTRALIFE", // Extra Life timer
"PUSHING",
"JUSTSPRUNG",
"NOAUTOBRAKE",
"SUPER", // Are you super?
"GRAVITYBOOTS", // gravity boots
// Weapon ammunition
"INFINITYRING",
"AUTOMATICRING",
"BOUNCERING",
"SCATTERRING",
"GRENADERING",
"EXPLOSIONRING",
"RAILRING",
// Power Stones
"EMERALDS", // stored like global 'emeralds' variable
// NiGHTS powerups
"NIGHTS_SUPERLOOP",
"NIGHTS_HELPER",
"NIGHTS_LINKFREEZE",
//for linedef exec 427
"NOCONTROL",
//for dyes
"DYE",
"JUSTLAUNCHED",
"IGNORELATCH"
};
const char *const KARTSTUFF_LIST[] = {
"POSITION",
"OLDPOSITION",
"POSITIONDELAY",
"THROWDIR",
"INSTASHIELD",
"FLOORBOOST",
"SPINOUTTYPE",
"DRIFT",
"DRIFTEND",
"DRIFTCHARGE",
"DRIFTBOOST",
"BOOSTCHARGE",
"STARTBOOST",
"RINGS",
"PICKUPRINGS",
"USERINGS",
"RINGDELAY",
"RINGBOOST",
"RINGLOCK",
"SPARKLEANIM",
"JMP",
"OFFROAD",
"BRAKESTOP",
"SPINDASH",
"SPINDASHSPEED",
"SPINDASHBOOST",
"WATERSKIP",
"DASHPADCOOLDOWN",
"NUMBOOSTS",
"BOOSTPOWER",
"SPEEDBOOST",
"ACCELBOOST",
"HANDLEBOOST",
"DRAFTPOWER",
"DRAFTLEEWAY",
"LASTDRAFT",
"BOOSTANGLE",
"AIZDRIFTSTRAT",
"BRAKEDRIFT",
"ITEMROULETTE",
"ROULETTETYPE",
"ITEMTYPE",
"ITEMAMOUNT",
"ITEMHELD",
"HOLDREADY",
"CURSHIELD",
"HYUDOROTIMER",
"STEALINGTIMER",
"STOLENTIMER",
"SUPERRING",
"SNEAKERTIMER",
"NUMSNEAKERS",
"GROWSHRINKTIMER",
"SQUISHEDTIMER",
"ROCKETSNEAKERTIMER",
"INVINCIBILITYTIMER",
"BUBBLECOOL",
"BUBBLEBLOWUP",
"FLAMEDASH",
"FLAMEMETER",
"FLAMELENGTH",
"EGGMANHELD",
"EGGMANEXPLODE",
"EGGMANBLAME",
"LASTJAWZTARGET",
"BANANADRAG",
"SPINOUTTIMER",
"WIPEOUTSLOW",
"JUSTBUMPED",
"COMEBACKTIMER",
"SADTIMER",
"BUMPER",
"COMEBACKPOINTS",
"COMEBACKMODE",
"WANTED",
"GETSPARKS",
"JAWZTARGETDELAY",
"SPECTATEWAIT",
"TIREGREASE",
"SPRINGSTARS",
"SPRINGCOLOR",
"KILLFIELD",
"WRONGWAY"
};
const char *const KARTHUD_LIST[] = {
"ITEMBLINK",
"ITEMBLINKMODE",
@ -6612,33 +6464,6 @@ struct int_const_s const INT_CONST[] = {
{"PRECIP_STORM_NORAIN",PRECIP_STORM_NORAIN},
{"PRECIP_STORM_NOSTRIKES",PRECIP_STORM_NOSTRIKES},
// Shields
{"SH_NONE",SH_NONE},
// Shield flags
{"SH_PROTECTFIRE",SH_PROTECTFIRE},
{"SH_PROTECTWATER",SH_PROTECTWATER},
{"SH_PROTECTELECTRIC",SH_PROTECTELECTRIC},
{"SH_PROTECTSPIKE",SH_PROTECTSPIKE},
// Indivisible shields
{"SH_PITY",SH_PITY},
{"SH_WHIRLWIND",SH_WHIRLWIND},
{"SH_ARMAGEDDON",SH_ARMAGEDDON},
{"SH_PINK",SH_PINK},
// normal shields that use flags
{"SH_ATTRACT",SH_ATTRACT},
{"SH_ELEMENTAL",SH_ELEMENTAL},
// Sonic 3 shields
{"SH_FLAMEAURA",SH_FLAMEAURA},
{"SH_BUBBLEWRAP",SH_BUBBLEWRAP},
{"SH_THUNDERCOIN",SH_THUNDERCOIN},
// The force shield uses the lower 8 bits to count how many extra hits are left.
{"SH_FORCE",SH_FORCE},
{"SH_FORCEHP",SH_FORCEHP}, // to be used as a bitmask only
// Mostly for use with Mario mode.
{"SH_FIREFLOWER",SH_FIREFLOWER},
{"SH_STACK",SH_STACK},
{"SH_NOSTACK",SH_NOSTACK},
// Carrying
{"CR_NONE",CR_NONE},
{"CR_ZOOMTUBE",CR_ZOOMTUBE},
@ -6647,10 +6472,6 @@ struct int_const_s const INT_CONST[] = {
{"SF_HIRES",SF_HIRES},
{"SF_MACHINE",SF_MACHINE},
// Dashmode constants
{"DASHMODE_THRESHOLD",DASHMODE_THRESHOLD},
{"DASHMODE_MAX",DASHMODE_MAX},
// Sound flags
{"SF_TOTALLYSINGLE",SF_TOTALLYSINGLE},
{"SF_NOMULTIPLESOUND",SF_NOMULTIPLESOUND},
@ -7086,7 +6907,6 @@ void DEH_TableCheck(void)
#if defined(_DEBUG) || defined(PARANOIA)
const size_t dehstates = sizeof(STATE_LIST)/sizeof(const char*);
const size_t dehmobjs = sizeof(MOBJTYPE_LIST)/sizeof(const char*);
const size_t dehpowers = sizeof(POWERS_LIST)/sizeof(const char*);
const size_t dehcolors = sizeof(COLOR_ENUMS)/sizeof(const char*);
if (dehstates != S_FIRSTFREESLOT)
@ -7095,9 +6915,6 @@ void DEH_TableCheck(void)
if (dehmobjs != MT_FIRSTFREESLOT)
I_Error("You forgot to update the Dehacked mobjtype list, you dolt!\n(%d mobj types defined, versus %s in the Dehacked list)\n", MT_FIRSTFREESLOT, sizeu1(dehmobjs));
if (dehpowers != NUMPOWERS)
I_Error("You forgot to update the Dehacked powers list, you dolt!\n(%d powers defined, versus %s in the Dehacked list)\n", NUMPOWERS, sizeu1(dehpowers));
if (dehcolors != SKINCOLOR_FIRSTFREESLOT)
I_Error("You forgot to update the Dehacked colors list, you dolt!\n(%d colors defined, versus %s in the Dehacked list)\n", SKINCOLOR_FIRSTFREESLOT, sizeu1(dehcolors));
#endif

View file

@ -67,7 +67,6 @@ extern const char *const GAMETYPERULE_LIST[];
extern const char *const ML_LIST[16]; // Linedef flags
extern const char *COLOR_ENUMS[];
extern const char *const POWERS_LIST[];
extern const char *const KARTSTUFF_LIST[];
extern const char *const KARTHUD_LIST[];
extern const char *const HUDITEMS_LIST[];
extern const char *const MENUTYPES_LIST[];

View file

@ -465,7 +465,7 @@ enum GameTypeRules
GTR_BUMPERS = 1<<3, // Enables the bumper health system
GTR_SPHERES = 1<<4, // Replaces rings with blue spheres
GTR_PAPERITEMS = 1<<5, // Replaces item boxes with paper item spawners
GTR_WANTED = 1<<6, // Enables the wanted anti-camping system
GTR_WANTED = 1<<6, // unused
GTR_KARMA = 1<<7, // Enables the Karma system if you're out of bumpers
GTR_ITEMARROWS = 1<<8, // Show item box arrows above players
GTR_CAPSULES = 1<<9, // Enables the wanted anti-camping system
@ -655,8 +655,6 @@ extern UINT8 useBlackRock;
extern UINT8 use1upSound;
extern UINT8 maxXtraLife; // Max extra lives from rings
extern UINT8 useContinues;
#define continuesInSession (!multiplayer && (ultimatemode || (useContinues && !marathonmode) || (!modeattacking && !(cursaveslot > 0))))
extern mobj_t *hunt1, *hunt2, *hunt3; // Emerald hunt locations

View file

@ -2909,7 +2909,7 @@ void F_TextPromptDrawer(void)
}
#define nocontrolallowed(j) {\
players[j].powers[pw_nocontrol] = 1;\
players[j].nocontrol = 1;\
if (players[j].mo)\
{\
if (players[j].mo->state == states+S_KART_STILL && players[j].mo->tics != -1)\
@ -2980,7 +2980,7 @@ void F_TextPromptTicker(void)
{
UINT8 j;
players[i].powers[pw_nocontrol] = 1;
players[i].nocontrol = 1;
// Both players' controls are locked,
// But only the triggering player can advance the prompt.

View file

@ -505,7 +505,7 @@ void G_ReadDemoTiccmd(ticcmd_t *cmd, INT32 playernum)
if (ziptic & ZT_LATENCY)
oldcmd[playernum].latency = READUINT8(demo_p);
if (ziptic & ZT_FLAGS)
oldcmd[playernum].latency = READUINT8(demo_p);
oldcmd[playernum].flags = READUINT8(demo_p);
G_CopyTiccmd(cmd, &oldcmd[playernum], 1);
@ -748,15 +748,15 @@ void G_WriteGhostTic(mobj_t *ghost, INT32 playernum)
}
if (ghost->player && (
ghostext[playernum].kartitem != ghost->player->kartstuff[k_itemtype] ||
ghostext[playernum].kartamount != ghost->player->kartstuff[k_itemamount] ||
ghostext[playernum].kartbumpers != ghost->player->kartstuff[k_bumper]
ghostext[playernum].kartitem != ghost->player->itemtype ||
ghostext[playernum].kartamount != ghost->player->itemamount ||
ghostext[playernum].kartbumpers != ghost->player->bumpers
))
{
ghostext[playernum].flags |= EZT_KART;
ghostext[playernum].kartitem = ghost->player->kartstuff[k_itemtype];
ghostext[playernum].kartamount = ghost->player->kartstuff[k_itemamount];
ghostext[playernum].kartbumpers = ghost->player->kartstuff[k_bumper];
ghostext[playernum].kartitem = ghost->player->itemtype;
ghostext[playernum].kartamount = ghost->player->itemamount;
ghostext[playernum].kartbumpers = ghost->player->bumpers;
}
if (ghostext[playernum].flags)
@ -1035,17 +1035,17 @@ void G_ConsGhostTic(INT32 playernum)
else
ghostext[playernum].desyncframes = 0;
if (players[playernum].kartstuff[k_itemtype] != ghostext[playernum].kartitem
|| players[playernum].kartstuff[k_itemamount] != ghostext[playernum].kartamount
|| players[playernum].kartstuff[k_bumper] != ghostext[playernum].kartbumpers)
if (players[playernum].itemtype != ghostext[playernum].kartitem
|| players[playernum].itemamount != ghostext[playernum].kartamount
|| players[playernum].bumpers != ghostext[playernum].kartbumpers)
{
if (demosynced)
CONS_Alert(CONS_WARNING, M_GetText("Demo playback has desynced!\n"));
demosynced = false;
players[playernum].kartstuff[k_itemtype] = ghostext[playernum].kartitem;
players[playernum].kartstuff[k_itemamount] = ghostext[playernum].kartamount;
players[playernum].kartstuff[k_bumper] = ghostext[playernum].kartbumpers;
players[playernum].itemtype = ghostext[playernum].kartitem;
players[playernum].itemamount = ghostext[playernum].kartamount;
players[playernum].bumpers = ghostext[playernum].kartbumpers;
}
}
@ -1402,7 +1402,7 @@ void G_StoreRewindInfo(void)
void G_PreviewRewind(tic_t previewtime)
{
SINT8 i;
size_t j;
//size_t j;
fixed_t tweenvalue = 0;
rewindinfo_t *info = rewindhead, *next_info = rewindhead;
@ -1461,8 +1461,9 @@ void G_PreviewRewind(tic_t previewtime)
players[i].mo->hitlag = info->playerinfo[i].mobj.hitlag;
players[i].realtime = info->playerinfo[i].player.realtime;
for (j = 0; j < NUMKARTSTUFF; j++)
players[i].kartstuff[j] = info->playerinfo[i].player.kartstuff[j];
// Genuinely CANNOT be fucked. I can redo lua and I can redo netsaves but I draw the line at this abysmal hack.
/*for (j = 0; j < NUMKARTSTUFF; j++)
players[i].kartstuff[j] = info->playerinfo[i].player.kartstuff[j];*/
}
for (i = splitscreen; i >= 0; i--)

View file

@ -270,7 +270,6 @@ INT32 flameseg = TICRATE/4;
UINT8 use1upSound = 0;
UINT8 maxXtraLife = 2; // Max extra lives from rings
UINT8 useContinues = 0; // Set to 1 to enable continues outside of no-save scenarioes
UINT8 introtoplay;
UINT8 creditscutscene;
@ -545,7 +544,7 @@ static void G_UpdateRecordReplays(void)
if (!mainrecords[gamemap-1])
G_AllocMainRecordData(gamemap-1);
if (players[consoleplayer].pflags & PF_GAMETYPEOVER)
if (players[consoleplayer].pflags & PF_NOCONTEST)
{
players[consoleplayer].realtime = UINT32_MAX;
}
@ -1112,7 +1111,6 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
cmd->forwardmove += (SINT8)forward;
cmd->latency = (leveltime & 0xFF); // Send leveltime when this tic was generated to the server for control lag calculations
cmd->flags = 0;
if (chat_on || CON_Ready())
@ -1138,6 +1136,10 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
if (addedtogame && gamestate == GS_LEVEL)
{
LUAh_PlayerCmd(player, cmd);
// Send leveltime when this tic was generated to the server for control lag calculations.
// Only do this when in a level. Also do this after the hook, so that it can't overwrite this.
cmd->latency = (leveltime & 0xFF);
}
if (cmd->forwardmove > MAXPLMOVE)
@ -1617,7 +1619,7 @@ boolean G_CouldView(INT32 playernum)
// SRB2Kart: Only go through players who are actually playing
if (player->exiting)
return false;
if (( player->pflags & PF_GAMETYPEOVER ))
if (( player->pflags & PF_NOCONTEST ))
return false;
// I don't know if we want this actually, but I'll humor the suggestion anyway
@ -2033,9 +2035,6 @@ static inline void G_PlayerFinishLevel(INT32 player)
p = &players[player];
memset(p->powers, 0, sizeof (p->powers));
memset(p->kartstuff, 0, sizeof (p->kartstuff)); // SRB2kart
p->mo->renderflags &= ~(RF_TRANSMASK|RF_BRIGHTMASK); // cancel invisibility
P_FlashPal(p, 0, 0); // Resets
@ -2064,10 +2063,8 @@ static inline void G_PlayerFinishLevel(INT32 player)
void G_PlayerReborn(INT32 player, boolean betweenmaps)
{
player_t *p;
INT32 score, marescore;
INT32 score, roundscore;
INT32 lives;
boolean lostlife;
INT32 continues;
UINT8 kartspeed;
UINT8 kartweight;
@ -2082,15 +2079,12 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps)
INT32 pflags;
INT32 ctfteam;
UINT8 ctfteam;
INT32 starpostnum;
INT32 exiting;
tic_t dashmode;
INT16 numboxes;
INT16 totalring;
UINT8 laps;
UINT8 mare;
UINT16 skincolor;
INT32 skin;
UINT32 availabilities;
@ -2121,20 +2115,14 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps)
INT32 roulettetype;
INT32 growshrinktimer;
INT32 bumper;
INT32 wanted;
boolean songcredit = false;
boolean eliminated;
UINT16 nocontrol;
INT32 khudfault;
INT32 kickstartaccel;
score = players[player].score;
marescore = players[player].marescore;
lives = players[player].lives;
lostlife = players[player].lostlife;
continues = players[player].continues;
ctfteam = players[player].ctfteam;
exiting = players[player].exiting;
jointime = players[player].jointime;
quittime = players[player].quittime;
@ -2142,21 +2130,9 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps)
splitscreenindex = players[player].splitscreenindex;
spectator = players[player].spectator;
pflags = (players[player].pflags & (PF_WANTSTOJOIN|PF_GAMETYPEOVER|PF_FAULT|PF_KICKSTARTACCEL));
steering = players[player].steering;
playerangleturn = players[player].angleturn;
// As long as we're not in multiplayer, carry over cheatcodes from map to map
if (!(netgame || multiplayer))
pflags |= (players[player].pflags & (PF_GODMODE|PF_NOCLIP|PF_INVIS));
dashmode = players[player].dashmode;
numboxes = players[player].numboxes;
laps = players[player].laps;
totalring = players[player].totalring;
skincolor = players[player].skincolor;
skin = players[player].skin;
@ -2164,7 +2140,6 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps)
kartspeed = players[player].kartspeed;
kartweight = players[player].kartweight;
follower = players[player].follower;
followerready = players[player].followerready;
followercolor = players[player].followercolor;
followerskin = players[player].followerskin;
@ -2173,20 +2148,18 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps)
charflags = players[player].charflags;
starpostnum = players[player].starpostnum;
followitem = players[player].followitem;
mare = players[player].mare;
bot = players[player].bot;
botdifficulty = players[player].botvars.difficulty;
botdiffincrease = players[player].botvars.diffincrease;
botrival = players[player].botvars.rival;
xtralife = players[player].xtralife;
pflags = (players[player].pflags & (PF_WANTSTOJOIN|PF_KICKSTARTACCEL));
// SRB2kart
if (betweenmaps || leveltime < starttime)
if (betweenmaps || leveltime < introtime)
{
itemroulette = 0;
roulettetype = 0;
@ -2196,47 +2169,64 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps)
bumper = ((gametyperules & GTR_BUMPERS) ? K_StartingBumperCount() : 0);
rings = ((gametyperules & GTR_SPHERES) ? 0 : 5);
spheres = 0;
eliminated = false;
wanted = 0;
kickstartaccel = 0;
khudfault = nocontrol = 0;
laps = 0;
totalring = 0;
roundscore = 0;
exiting = 0;
starpostnum = 0;
xtralife = 0;
follower = NULL;
}
else
{
itemroulette = (players[player].kartstuff[k_itemroulette] > 0 ? 1 : 0);
roulettetype = players[player].kartstuff[k_roulettetype];
itemroulette = (players[player].itemroulette > 0 ? 1 : 0);
roulettetype = players[player].roulettetype;
if (players[player].kartstuff[k_itemheld])
if (players[player].pflags & PF_ITEMOUT)
{
itemtype = 0;
itemamount = 0;
}
else
{
itemtype = players[player].kartstuff[k_itemtype];
itemamount = players[player].kartstuff[k_itemamount];
itemtype = players[player].itemtype;
itemamount = players[player].itemamount;
}
// Keep Shrink status, remove Grow status
if (players[player].kartstuff[k_growshrinktimer] < 0)
growshrinktimer = players[player].kartstuff[k_growshrinktimer];
if (players[player].growshrinktimer < 0)
growshrinktimer = players[player].growshrinktimer;
else
growshrinktimer = 0;
bumper = players[player].bumpers;
rings = players[player].rings;
spheres = players[player].spheres;
eliminated = players[player].eliminated;
wanted = players[player].kartstuff[k_wanted];
kickstartaccel = players[player].kickstartaccel;
khudfault = players[player].karthud[khud_fault];
nocontrol = players[player].nocontrol;
laps = players[player].laps;
totalring = players[player].totalring;
roundscore = players[player].roundscore;
exiting = players[player].exiting;
starpostnum = players[player].starpostnum;
xtralife = players[player].xtralife;
follower = players[player].follower;
pflags |= (players[player].pflags & (PF_STASIS|PF_ELIMINATED|PF_NOCONTEST|PF_FAULT|PF_LOSTLIFE));
}
if (!betweenmaps)
{
khudfault = players[player].karthud[khud_fault];
nocontrol = players[player].powers[pw_nocontrol];
}
else
khudfault = nocontrol = 0;
// As long as we're not in multiplayer, carry over cheatcodes from map to map
if (!(netgame || multiplayer))
pflags |= (players[player].pflags & (PF_GODMODE|PF_NOCLIP));
// Obliterate follower from existence
P_SetTarget(&players[player].follower, NULL);
@ -2247,10 +2237,8 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps)
memset(p, 0, sizeof (*p));
p->score = score;
p->marescore = marescore;
p->roundscore = roundscore;
p->lives = lives;
p->lostlife = lostlife;
p->continues = continues;
p->pflags = pflags;
p->ctfteam = ctfteam;
p->jointime = jointime;
@ -2273,13 +2261,9 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps)
p->starpostnum = starpostnum;
p->exiting = exiting;
p->dashmode = dashmode;
p->numboxes = numboxes;
p->laps = laps;
p->totalring = totalring;
p->mare = mare;
p->bot = bot;
p->botvars.difficulty = botdifficulty;
p->rings = rings;
@ -2289,19 +2273,17 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps)
p->xtralife = xtralife;
// SRB2kart
p->kartstuff[k_itemroulette] = itemroulette;
p->kartstuff[k_roulettetype] = roulettetype;
p->kartstuff[k_itemtype] = itemtype;
p->kartstuff[k_itemamount] = itemamount;
p->kartstuff[k_growshrinktimer] = growshrinktimer;
p->itemroulette = itemroulette;
p->roulettetype = roulettetype;
p->itemtype = itemtype;
p->itemamount = itemamount;
p->growshrinktimer = growshrinktimer;
p->bumpers = bumper;
p->karmadelay = comebacktime;
p->eliminated = eliminated;
p->kartstuff[k_wanted] = wanted;
p->kartstuff[k_eggmanblame] = -1;
p->kartstuff[k_lastdraft] = -1;
p->eggmanblame = -1;
p->lastdraft = -1;
p->karthud[khud_fault] = khudfault;
p->powers[pw_nocontrol] = nocontrol;
p->nocontrol = nocontrol;
p->kickstartaccel = kickstartaccel;
memcpy(&p->respawn, &respawn, sizeof (p->respawn));
@ -2866,7 +2848,7 @@ UINT32 gametypedefaultrules[NUMGAMETYPES] =
// Race
GTR_CIRCUIT|GTR_BOTS,
// Battle
GTR_SPHERES|GTR_BUMPERS|GTR_PAPERITEMS|GTR_WANTED|GTR_KARMA|GTR_ITEMARROWS|GTR_CAPSULES|GTR_BATTLESTARTS|GTR_POINTLIMIT|GTR_TIMELIMIT|GTR_OVERTIME
GTR_SPHERES|GTR_BUMPERS|GTR_PAPERITEMS|GTR_KARMA|GTR_ITEMARROWS|GTR_CAPSULES|GTR_BATTLESTARTS|GTR_POINTLIMIT|GTR_TIMELIMIT|GTR_OVERTIME
};
//
@ -3476,7 +3458,7 @@ static void G_DoCompleted(void)
if (playeringame[i])
{
// SRB2Kart: exitlevel shouldn't get you the points
if (!players[i].exiting && !(players[i].pflags & PF_GAMETYPEOVER))
if (!players[i].exiting && !(players[i].pflags & PF_NOCONTEST))
{
if (players[i].bot)
{
@ -3484,7 +3466,7 @@ static void G_DoCompleted(void)
}
else
{
players[i].pflags |= PF_GAMETYPEOVER;
players[i].pflags |= PF_NOCONTEST;
if (P_IsLocalPlayer(&players[i]))
{
@ -3798,8 +3780,8 @@ static void G_DoContinued(void)
I_Assert(!netgame && !multiplayer);
I_Assert(pl->continues > 0);
if (pl->continues)
pl->continues--;
/*if (pl->continues)
pl->continues--;*/
// Reset score
pl->score = 0;
@ -4467,16 +4449,12 @@ void G_InitNew(UINT8 pencoremode, const char *mapname, boolean resetplayer, bool
for (i = 0; i < MAXPLAYERS; i++)
{
players[i].playerstate = PST_REBORN;
players[i].starpostnum = 0;
memset(&players[i].respawn, 0, sizeof (players[i].respawn));
// The latter two should clear by themselves, but just in case
players[i].pflags &= ~(PF_GAMETYPEOVER|PF_STASIS|PF_FAULT);
// Clear cheatcodes too, just in case.
players[i].pflags &= ~(PF_GODMODE|PF_NOCLIP|PF_INVIS);
players[i].pflags &= ~(PF_GODMODE|PF_NOCLIP);
players[i].marescore = 0;
players[i].roundscore = 0;
if (resetplayer && !(multiplayer && demo.playback)) // SRB2Kart
{

View file

@ -4085,8 +4085,7 @@ static void HWR_DrawSprite(gl_vissprite_t *spr)
gpatch = spr->gpatch;
#ifdef ALAM_LIGHTING
if (!(spr->mobj->flags2 & MF2_DEBRIS) && (spr->mobj->sprite != SPR_PLAY ||
(spr->mobj->player && spr->mobj->player->powers[pw_super])))
if (!(spr->mobj->flags2 & MF2_DEBRIS) && (spr->mobj->sprite != SPR_PLAY))
HWR_DL_AddLight(spr, gpatch);
#endif

View file

@ -1565,7 +1565,7 @@ boolean HWR_DrawModel(gl_vissprite_t *spr)
&& (spr->mobj->frame & FF_ANIMATE
|| (spr->mobj->state->nextstate != S_NULL
&& states[spr->mobj->state->nextstate].sprite == SPR_PLAY
&& ((P_GetSkinSprite2(spr->mobj->skin, (((spr->mobj->player && spr->mobj->player->powers[pw_super]) ? FF_SPR2SUPER : 0)|states[spr->mobj->state->nextstate].frame) & FF_FRAMEMASK, spr->mobj->player) == spr->mobj->sprite2)))))
&& ((P_GetSkinSprite2(spr->mobj->skin, (states[spr->mobj->state->nextstate].frame) & FF_FRAMEMASK, spr->mobj->player) == spr->mobj->sprite2)))))
{
nextFrame = (spr->mobj->frame & FF_FRAMEMASK) + 1;
if (nextFrame >= mod)

View file

@ -2353,11 +2353,11 @@ static void HU_DrawRankings(void)
if (completed[i] || !playeringame[i] || players[i].spectator || !players[i].mo)
continue;
if (players[i].kartstuff[k_position] >= lowestposition)
if (players[i].position >= lowestposition)
continue;
tab[scorelines].num = i;
lowestposition = players[i].kartstuff[k_position];
lowestposition = players[i].position;
}
i = tab[scorelines].num;
@ -2374,7 +2374,7 @@ static void HU_DrawRankings(void)
tab[scorelines].count = players[i].realtime;
}
else
tab[scorelines].count = players[i].marescore;
tab[scorelines].count = players[i].roundscore;
scorelines++;

View file

@ -541,6 +541,8 @@ char sprnames[NUMSPRITES + 1][5] =
"DRIF", // Drift Sparks
"BDRF", // Brake drift sparks
"DRWS", // Drift dust sparks
"DREL", // Drift electricity
"DRES", // Drift electric sparks
"JANK", // Stair janking sparks
// Kart Items
@ -2127,31 +2129,31 @@ state_t states[NUMSTATES] =
// Box Icons -- 2 states each, animation and action
{SPR_TVRI, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_RING_ICON2}, // S_RING_ICON1
{SPR_TVRI, 2, 18, {A_RingBox}, 0, 0, S_NULL}, // S_RING_ICON2
{SPR_TVRI, 2, 18, {NULL}, 0, 0, S_NULL}, // S_RING_ICON2
{SPR_TVPI, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_PITY_ICON2}, // S_PITY_ICON1
{SPR_TVPI, 2, 18, {A_GiveShield}, SH_PITY, 0, S_NULL}, // S_PITY_ICON2
{SPR_TVPI, 2, 18, {NULL}, 0, 0, S_NULL}, // S_PITY_ICON2
{SPR_TVAT, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_ATTRACT_ICON2}, // S_ATTRACT_ICON1
{SPR_TVAT, 2, 18, {A_GiveShield}, SH_ATTRACT, 0, S_NULL}, // S_ATTRACT_ICON2
{SPR_TVAT, 2, 18, {NULL}, 0, 0, S_NULL}, // S_ATTRACT_ICON2
{SPR_TVFO, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_FORCE_ICON2}, // S_FORCE_ICON1
{SPR_TVFO, 2, 18, {A_GiveShield}, SH_FORCE|1, 0, S_NULL}, // S_FORCE_ICON2
{SPR_TVFO, 2, 18, {NULL}, 0, 0, S_NULL}, // S_FORCE_ICON2
{SPR_TVAR, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_ARMAGEDDON_ICON2}, // S_ARMAGEDDON_ICON1
{SPR_TVAR, 2, 18, {A_GiveShield}, SH_ARMAGEDDON, 0, S_NULL}, // S_ARMAGEDDON_ICON2
{SPR_TVAR, 2, 18, {NULL}, 0, 0, S_NULL}, // S_ARMAGEDDON_ICON2
{SPR_TVWW, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_WHIRLWIND_ICON2}, // S_WHIRLWIND_ICON1
{SPR_TVWW, 2, 18, {A_GiveShield}, SH_WHIRLWIND, 0, S_NULL}, // S_WHIRLWIND_ICON2
{SPR_TVWW, 2, 18, {NULL}, 0, 0, S_NULL}, // S_WHIRLWIND_ICON2
{SPR_TVEL, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_ELEMENTAL_ICON2}, // S_ELEMENTAL_ICON1
{SPR_TVEL, 2, 18, {A_GiveShield}, SH_ELEMENTAL, 0, S_NULL}, // S_ELEMENTAL_ICON2
{SPR_TVEL, 2, 18, {NULL}, 0, 0, S_NULL}, // S_ELEMENTAL_ICON2
{SPR_TVSS, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_SNEAKERS_ICON2}, // S_SNEAKERS_ICON1
{SPR_TVSS, 2, 18, {A_SuperSneakers}, 0, 0, S_NULL}, // S_SNEAKERS_ICON2
{SPR_TVSS, 2, 18, {NULL}, 0, 0, S_NULL}, // S_SNEAKERS_ICON2
{SPR_TVIV, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_INVULN_ICON2}, // S_INVULN_ICON1
{SPR_TVIV, 2, 18, {A_Invincibility}, 0, 0, S_NULL}, // S_INVULN_ICON2
{SPR_TVIV, 2, 18, {NULL}, 0, 0, S_NULL}, // S_INVULN_ICON2
{SPR_TV1U, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_1UP_ICON2}, // S_1UP_ICON1
{SPR_TV1U, 2, 18, {NULL}, 0, 0, S_NULL}, // S_1UP_ICON2
@ -2163,7 +2165,7 @@ state_t states[NUMSTATES] =
{SPR_TVMX, 2, 18, {A_MixUp}, 0, 0, S_NULL}, // S_MIXUP_ICON2
{SPR_TVGV, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_GRAVITY_ICON2}, // S_GRAVITY_ICON1
{SPR_TVGV, 2, 18, {A_GravityBox}, 0, 0, S_NULL}, // S_GRAVITY_ICON2
{SPR_TVGV, 2, 18, {NULL}, 0, 0, S_NULL}, // S_GRAVITY_ICON2
{SPR_TVRC, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_RECYCLER_ICON2}, // S_RECYCLER_ICON1
{SPR_TVRC, 2, 18, {NULL}, 0, 0, S_NULL}, // S_RECYCLER_ICON2
@ -2175,13 +2177,13 @@ state_t states[NUMSTATES] =
{SPR_TVTK, 2, 18, {A_AwardScore}, 0, 0, S_NULL}, // S_SCORE10K_ICON2
{SPR_TVFL, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_FLAMEAURA_ICON2}, // S_FLAMEAURA_ICON1
{SPR_TVFL, 2, 18, {A_GiveShield}, SH_FLAMEAURA, 0, S_NULL}, // S_FLAMEAURA_ICON2
{SPR_TVFL, 2, 18, {NULL}, 0, 0, S_NULL}, // S_FLAMEAURA_ICON2
{SPR_TVBB, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_BUBBLEWRAP_ICON2}, // S_BUBBLEWRAP_ICON1
{SPR_TVBB, 2, 18, {A_GiveShield}, SH_BUBBLEWRAP, 0, S_NULL}, // S_BUBBLERWAP_ICON2
{SPR_TVBB, 2, 18, {NULL}, 0, 0, S_NULL}, // S_BUBBLERWAP_ICON2
{SPR_TVZP, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_THUNDERCOIN_ICON2}, // S_THUNDERCOIN_ICON1
{SPR_TVZP, 2, 18, {A_GiveShield}, SH_THUNDERCOIN, 0, S_NULL}, // S_THUNDERCOIN_ICON2
{SPR_TVZP, 2, 18, {NULL}, 0, 0, S_NULL}, // S_THUNDERCOIN_ICON2
// ---
@ -4097,6 +4099,9 @@ state_t states[NUMSTATES] =
{SPR_DRWS, FF_FULLBRIGHT|FF_TRANS20|2, 3, {NULL}, 0, 0, S_DRIFTWARNSPARK4}, // S_DRIFTWARNSPARK3
{SPR_DRWS, FF_FULLBRIGHT|FF_TRANS20|3, 3, {NULL}, 0, 0, S_NULL}, // S_DRIFTWARNSPARK4
{SPR_DREL, FF_FULLBRIGHT|FF_PAPERSPRITE|FF_ANIMATE|FF_GLOBALANIM, 2, {NULL}, 5, 2, S_NULL}, // S_DRIFTELECTRICITY
{SPR_DRES, FF_FULLBRIGHT|FF_PAPERSPRITE|FF_ANIMATE, 20, {NULL}, 1, 10, S_NULL}, // S_DRIFTELECTRICSPARK
{SPR_FAST, FF_PAPERSPRITE|FF_FULLBRIGHT, 1, {NULL}, 0, 0, S_FASTLINE2}, // S_FASTLINE1
{SPR_FAST, FF_PAPERSPRITE|FF_FULLBRIGHT|1, 1, {NULL}, 0, 0, S_FASTLINE3}, // S_FASTLINE2
{SPR_FAST, FF_PAPERSPRITE|FF_FULLBRIGHT|2, 1, {NULL}, 0, 0, S_FASTLINE4}, // S_FASTLINE3
@ -17461,7 +17466,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
SH_ELEMENTAL, // speed
0, // speed
64*FRACUNIT, // radius
64*FRACUNIT, // height
4, // display offset
@ -17488,7 +17493,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
SH_ATTRACT, // speed
0, // speed
64*FRACUNIT, // radius
64*FRACUNIT, // height
4, // display offset
@ -17515,7 +17520,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
SH_FORCE, // speed
0, // speed
64*FRACUNIT, // radius
64*FRACUNIT, // height
4, // display offset
@ -17542,7 +17547,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
SH_ARMAGEDDON, // speed
0, // speed
64*FRACUNIT, // radius
64*FRACUNIT, // height
4, // display offset
@ -17569,7 +17574,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
SH_WHIRLWIND, // speed
0, // speed
64*FRACUNIT, // radius
64*FRACUNIT, // height
4, // display offset
@ -17596,7 +17601,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
SH_PITY, // speed
0, // speed
64*FRACUNIT, // radius
64*FRACUNIT, // height
4, // display offset
@ -17623,7 +17628,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
SH_FLAMEAURA, // speed
0, // speed
64*FRACUNIT, // radius
64*FRACUNIT, // height
-4, // display offset
@ -17650,7 +17655,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
SH_BUBBLEWRAP, // speed
0, // speed
64*FRACUNIT, // radius
64*FRACUNIT, // height
4, // display offset
@ -17677,7 +17682,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
SH_THUNDERCOIN, // speed
0, // speed
64*FRACUNIT, // radius
64*FRACUNIT, // height
-4, // display offset
@ -19770,7 +19775,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
24*FRACUNIT, // radius
24*FRACUNIT, // height
0, // display offset
pw_bouncering, // mass
0, // mass
0, // damage
sfx_None, // activesound
MF_SLIDEME|MF_SPECIAL|MF_NOGRAVITY|MF_NOCLIPHEIGHT, // flags
@ -19797,7 +19802,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
24*FRACUNIT, // radius
24*FRACUNIT, // height
0, // display offset
pw_railring, // mass
0, // mass
0, // damage
sfx_None, // activesound
MF_SLIDEME|MF_SPECIAL|MF_NOGRAVITY|MF_NOCLIPHEIGHT, // flags
@ -19824,7 +19829,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
24*FRACUNIT, // radius
24*FRACUNIT, // height
0, // display offset
pw_infinityring,// mass
0, // mass
0, // damage
sfx_None, // activesound
MF_SLIDEME|MF_SPECIAL|MF_NOGRAVITY|MF_NOCLIPHEIGHT, // flags
@ -19851,7 +19856,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
24*FRACUNIT, // radius
24*FRACUNIT, // height
0, // display offset
pw_automaticring, // mass
0, // mass
0, // damage
sfx_None, // activesound
MF_SLIDEME|MF_SPECIAL|MF_NOGRAVITY|MF_NOCLIPHEIGHT, // flags
@ -19878,7 +19883,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
24*FRACUNIT, // radius
24*FRACUNIT, // height
0, // display offset
pw_explosionring, // mass
0, // mass
0, // damage
sfx_None, // activesound
MF_SLIDEME|MF_SPECIAL|MF_NOGRAVITY|MF_NOCLIPHEIGHT, // flags
@ -19905,7 +19910,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
24*FRACUNIT, // radius
24*FRACUNIT, // height
0, // display offset
pw_scatterring, // mass
0, // mass
0, // damage
sfx_None, // activesound
MF_SLIDEME|MF_SPECIAL|MF_NOGRAVITY|MF_NOCLIPHEIGHT, // flags
@ -19932,7 +19937,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
24*FRACUNIT, // radius
24*FRACUNIT, // height
0, // display offset
pw_grenadering, // mass
0, // mass
0, // damage
sfx_None, // activesound
MF_SLIDEME|MF_SPECIAL|MF_NOGRAVITY|MF_NOCLIPHEIGHT, // flags
@ -19960,7 +19965,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
24*FRACUNIT, // radius
24*FRACUNIT, // height
0, // display offset
pw_bouncering, // mass
0, // mass
2*TICRATE, // damage
sfx_None, // activesound
MF_SLIDEME|MF_SPECIAL|MF_NOGRAVITY|MF_NOCLIPHEIGHT, // flags
@ -19987,7 +19992,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
24*FRACUNIT, // radius
24*FRACUNIT, // height
0, // display offset
pw_railring, // mass
0, // mass
2*TICRATE, // damage
sfx_None, // activesound
MF_SLIDEME|MF_SPECIAL|MF_NOGRAVITY|MF_NOCLIPHEIGHT, // flags
@ -20014,7 +20019,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
24*FRACUNIT, // radius
24*FRACUNIT, // height
0, // display offset
pw_automaticring, // mass
0, // mass
2*TICRATE, // damage
sfx_None, // activesound
MF_SLIDEME|MF_SPECIAL|MF_NOGRAVITY|MF_NOCLIPHEIGHT, // flags
@ -20041,7 +20046,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
24*FRACUNIT, // radius
24*FRACUNIT, // height
0, // display offset
pw_explosionring, // mass
0, // mass
2*TICRATE, // damage
sfx_None, // activesound
MF_SLIDEME|MF_SPECIAL|MF_NOGRAVITY|MF_NOCLIPHEIGHT, // flags
@ -20068,7 +20073,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
24*FRACUNIT, // radius
24*FRACUNIT, // height
0, // display offset
pw_scatterring, // mass
0, // mass
2*TICRATE, // damage
sfx_None, // activesound
MF_SLIDEME|MF_SPECIAL|MF_NOGRAVITY|MF_NOCLIPHEIGHT, // flags
@ -20095,7 +20100,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
24*FRACUNIT, // radius
24*FRACUNIT, // height
0, // display offset
pw_grenadering, // mass
0, // mass
2*TICRATE, // damage
sfx_None, // activesound
MF_SLIDEME|MF_SPECIAL|MF_NOGRAVITY|MF_NOCLIPHEIGHT, // flags
@ -23480,6 +23485,60 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL // raisestate
},
{ // MT_DRIFTELECTRICITY
-1, // doomednum
S_DRIFTELECTRICITY, // 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
16*FRACUNIT, // radius
32*FRACUNIT, // height
0, // display offset
0, // mass
0, // damage
sfx_None, // activesound
MF_NOBLOCKMAP|MF_NOCLIPHEIGHT|MF_NOCLIP|MF_NOCLIPTHING|MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP, // flags
S_NULL // raisestate
},
{ // MT_DRIFTELECTRICSPARK
-1, // doomednum
S_DRIFTELECTRICSPARK, // 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
4*FRACUNIT, // speed
9*FRACUNIT, // radius
37*FRACUNIT, // height
0, // display offset
0, // mass
0, // damage
sfx_None, // activesound
MF_NOBLOCKMAP|MF_NOCLIPHEIGHT|MF_NOCLIP|MF_NOCLIPTHING|MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP, // flags
S_NULL // raisestate
},
{ // MT_JANKSPARK
-1, // doomednum
S_JANKSPARK1, // spawnstate

View file

@ -40,18 +40,13 @@ enum actionnum
A_FACETRACER,
A_SCREAM,
A_BOSSDEATH,
A_CUSTOMPOWER,
A_RINGBOX,
A_INVINCIBILITY,
A_SUPERSNEAKERS,
A_BUNNYHOP,
A_BUBBLESPAWN,
A_FANBUBBLESPAWN,
A_BUBBLERISE,
A_BUBBLECHECK,
A_AWARDSCORE,
A_GIVESHIELD,
A_GRAVITYBOX,
A_SCORERISE,
A_ATTRACTCHASE,
A_DROPMINE,
@ -311,18 +306,13 @@ void A_FaceTarget();
void A_FaceTracer();
void A_Scream();
void A_BossDeath();
void A_CustomPower(); // Use this for a custom power
void A_RingBox(); // Obtained Ring Box Tails
void A_Invincibility(); // Obtained Invincibility Box
void A_SuperSneakers(); // Obtained Super Sneakers Box
void A_BunnyHop(); // have bunny hop tails
void A_BubbleSpawn(); // Randomly spawn bubbles
void A_FanBubbleSpawn();
void A_BubbleRise(); // Bubbles float to surface
void A_BubbleCheck(); // Don't draw if not underwater
void A_AwardScore();
void A_GiveShield(); // Obtained Shield
void A_GravityBox();
void A_ScoreRise(); // Rise the score logo
void A_AttractChase(); // Ring Chase
void A_DropMine(); // Drop Mine from Skim or Jetty-Syn Bomber
@ -1093,6 +1083,8 @@ typedef enum sprite
SPR_DRIF, // Drift Sparks
SPR_BDRF, // Brake drift sparks
SPR_DRWS, // Drift dust sparks
SPR_DREL, // Drift electricity
SPR_DRES, // Drift electric sparks
SPR_JANK, // Stair janking sparks
// Kart Items
@ -4501,6 +4493,10 @@ typedef enum state
S_DRIFTWARNSPARK3,
S_DRIFTWARNSPARK4,
// Drift electricity
S_DRIFTELECTRICITY,
S_DRIFTELECTRICSPARK,
// Fast lines
S_FASTLINE1,
S_FASTLINE2,
@ -6468,6 +6464,8 @@ typedef enum mobj_type
MT_DRIFTSPARK,
MT_BRAKEDRIFT,
MT_DRIFTDUST,
MT_DRIFTELECTRICITY,
MT_DRIFTELECTRICSPARK,
MT_JANKSPARK,
MT_ROCKETSNEAKER,

View file

@ -41,140 +41,7 @@ INT32 K_StartingBumperCount(void)
boolean K_IsPlayerWanted(player_t *player)
{
#if 1
return (player->kartstuff[k_position] == 1);
#else
UINT8 i;
if (!(gametyperules & GTR_WANTED))
return false;
for (i = 0; i < 4; i++)
{
if (battlewanted[i] == -1)
break;
if (player == &players[battlewanted[i]])
return true;
}
return false;
#endif
}
void K_CalculateBattleWanted(void)
{
UINT8 numingame = 0, numwanted = 0;
SINT8 camppos[MAXPLAYERS]; // who is the biggest camper
UINT8 ties = 0, nextcamppos = 0;
UINT8 i, j;
#if 0
if (!(gametyperules & GTR_WANTED))
#endif
{
memset(battlewanted, -1, sizeof (battlewanted));
return;
}
wantedcalcdelay = wantedfrequency;
memset(camppos, -1, sizeof (camppos)); // initialize
for (i = 0; i < MAXPLAYERS; i++)
{
UINT8 position = 1;
if (!playeringame[i] || players[i].spectator) // Not playing
continue;
if (players[i].exiting) // We're done, don't calculate.
return;
if (players[i].bumpers <= 0) // Not alive, so don't do anything else
continue;
numingame++;
for (j = 0; j < MAXPLAYERS; j++)
{
if (!playeringame[j] || players[j].spectator)
continue;
if (players[j].bumpers <= 0)
continue;
if (j == i)
continue;
if (K_NumEmeralds(&players[j]) > K_NumEmeralds(&players[i]))
{
position++;
}
else if (players[j].bumpers > players[i].bumpers)
{
position++;
}
else if (players[j].marescore > players[i].marescore)
{
position++;
}
else if (players[j].kartstuff[k_wanted] > players[i].kartstuff[k_wanted])
{
position++;
}
}
position--; // Make zero based
while (camppos[position] != -1) // Port priority!
position++;
camppos[position] = i;
}
if (numingame <= 2) // In 1v1s then there's no need for WANTED.
numwanted = 0;
else
numwanted = min(4, 1 + ((numingame-2) / 4));
for (i = 0; i < 4; i++)
{
if (i+1 > numwanted) // Not enough players for this slot to be wanted!
{
battlewanted[i] = -1;
}
else
{
// Do not add *any* more people if there's too many times that are tied with others.
// This could theoretically happen very easily if people don't hit each other for a while after the start of a match.
// (I will be sincerely impressed if more than 2 people tie after people start hitting each other though)
if (camppos[nextcamppos] == -1 // Out of entries
|| ties >= (numwanted-i)) // Already counted ties
{
battlewanted[i] = -1;
continue;
}
if (ties < (numwanted-i))
{
ties = 0; // Reset
for (j = 0; j < 2; j++)
{
if (camppos[nextcamppos+(j+1)] == -1) // Nothing beyond, cancel
break;
if (players[camppos[nextcamppos]].kartstuff[k_wanted] == players[camppos[nextcamppos+(j+1)]].kartstuff[k_wanted])
ties++;
}
}
if (ties < (numwanted-i)) // Is it still low enough after counting?
{
battlewanted[i] = camppos[nextcamppos];
nextcamppos++;
}
else
battlewanted[i] = -1;
}
}
return (player->position == 1);
}
void K_SpawnBattlePoints(player_t *source, player_t *victim, UINT8 amount)
@ -226,7 +93,7 @@ void K_CheckBumpers(void)
return;
numingame++;
winnerscoreadd += players[i].marescore;
winnerscoreadd += players[i].roundscore;
if (players[i].bumpers <= 0) // if you don't have any bumpers, you're probably not a winner
{
@ -237,7 +104,7 @@ void K_CheckBumpers(void)
return;
winnernum = i;
winnerscoreadd -= players[i].marescore;
winnerscoreadd -= players[i].roundscore;
}
if (numingame <= 1)
@ -253,7 +120,7 @@ void K_CheckBumpers(void)
{
for (i = 0; i < MAXPLAYERS; i++)
{
players[i].pflags |= PF_GAMETYPEOVER;
players[i].pflags |= PF_NOCONTEST;
P_DoPlayerExit(&players[i]);
}
}
@ -264,7 +131,7 @@ void K_CheckBumpers(void)
if (winnernum > -1 && playeringame[winnernum])
{
players[winnernum].marescore += winnerscoreadd;
players[winnernum].roundscore += winnerscoreadd;
CONS_Printf(M_GetText("%s recieved %d point%s for winning!\n"), player_names[winnernum], winnerscoreadd, (winnerscoreadd == 1 ? "" : "s"));
}
@ -279,12 +146,12 @@ void K_CheckEmeralds(player_t *player)
{
UINT8 i;
if (!ALLCHAOSEMERALDS(player->powers[pw_emeralds]))
if (!ALLCHAOSEMERALDS(player->emeralds))
{
return;
}
player->marescore++; // lol
player->roundscore++; // lol
for (i = 0; i < MAXPLAYERS; i++)
{
@ -371,12 +238,12 @@ void K_DropEmeraldsFromPlayer(player_t *player, UINT32 emeraldType)
{
UINT32 emeraldFlag = (1 << i);
if ((player->powers[pw_emeralds] & emeraldFlag) && (emeraldFlag & emeraldType))
if ((player->emeralds & emeraldFlag) && (emeraldFlag & emeraldType))
{
mobj_t *emerald = K_SpawnChaosEmerald(player->mo->x, player->mo->y, player->mo->z, player->mo->angle - ANGLE_90, flip, emeraldFlag);
P_SetTarget(&emerald->target, player->mo);
player->powers[pw_emeralds] &= ~emeraldFlag;
player->emeralds &= ~emeraldFlag;
}
}
}
@ -390,7 +257,7 @@ UINT8 K_NumEmeralds(player_t *player)
{
UINT32 emeraldFlag = (1 << i);
if (player->powers[pw_emeralds] & emeraldFlag)
if (player->emeralds & emeraldFlag)
{
num++;
}
@ -443,9 +310,9 @@ void K_RunPaperItemSpawners(void)
continue;
}
emeraldsSpawned |= players[i].powers[pw_emeralds];
emeraldsSpawned |= players[i].emeralds;
if ((players[i].exiting > 0 || players[i].eliminated)
if ((players[i].exiting > 0 || (players[i].pflags & PF_ELIMINATED))
|| ((gametyperules & GTR_BUMPERS) && players[i].bumpers <= 0))
{
continue;

View file

@ -17,7 +17,7 @@ extern UINT8 maptargets, numtargets;
INT32 K_StartingBumperCount(void);
boolean K_IsPlayerWanted(player_t *player);
void K_CalculateBattleWanted(void);
#define K_CalculateBattleWanted() (void)0 // not nulled out so we know where we need to recalculate some other form of battle mode importance
void K_SpawnBattlePoints(player_t *source, player_t *victim, UINT8 amount);
void K_CheckBumpers(void);
void K_CheckEmeralds(player_t *player);

View file

@ -274,10 +274,10 @@ boolean K_PlayerUsesBotMovement(player_t *player)
boolean K_BotCanTakeCut(player_t *player)
{
if (!K_ApplyOffroad(player)
|| player->kartstuff[k_itemtype] == KITEM_SNEAKER
|| player->kartstuff[k_itemtype] == KITEM_ROCKETSNEAKER
|| player->kartstuff[k_itemtype] == KITEM_INVINCIBILITY
|| player->kartstuff[k_itemtype] == KITEM_HYUDORO)
|| player->itemtype == KITEM_SNEAKER
|| player->itemtype == KITEM_ROCKETSNEAKER
|| player->itemtype == KITEM_INVINCIBILITY
|| player->itemtype == KITEM_HYUDORO)
return true;
return false;
@ -716,9 +716,14 @@ static UINT8 K_TrySpindash(player_t *player)
{
const tic_t difficultyModifier = (TICRATE/6);
if (player->kartstuff[k_spindashboost] || player->kartstuff[k_tiregrease])
const fixed_t oldSpeed = R_PointToDist2(0, 0, player->rmomx, player->rmomy);
const fixed_t baseAccel = K_GetNewSpeed(player) - oldSpeed;
const fixed_t speedDiff = player->speed - player->lastspeed;
if (player->spindashboost || player->tiregrease)
{
// You just released a spindash, you don't need to try again yet, jeez.
player->botvars.spindashconfirm = 0;
return 0;
}
@ -749,15 +754,29 @@ static UINT8 K_TrySpindash(player_t *player)
}
// Logic for normal racing.
if (player->powers[pw_flashing] > 0)
if (player->flashing > 0)
{
// Don't bother trying to spindash.
// Trying to spindash while flashing is fine during POSITION, but not during the actual race.
return 0;
}
if (player->speed < 10*mapobjectscale // Below the speed threshold
&& player->kartstuff[k_speedboost] < (FRACUNIT/8)) // If you have other boosts, you can probably trust it.
if (speedDiff < (3 * baseAccel / 4))
{
if (player->botvars.spindashconfirm < BOTSPINDASHCONFIRM)
{
player->botvars.spindashconfirm++;
}
}
else
{
if (player->botvars.spindashconfirm > 0)
{
player->botvars.spindashconfirm--;
}
}
if (player->botvars.spindashconfirm >= BOTSPINDASHCONFIRM)
{
INT32 chargingPoint = (K_GetSpindashChargeTime(player) + difficultyModifier);
@ -765,7 +784,7 @@ static UINT8 K_TrySpindash(player_t *player)
// Sounds counter-productive, but that's actually the best strategy after the race has started.
chargingPoint -= player->botvars.difficulty * difficultyModifier;
if (player->kartstuff[k_spindash] > chargingPoint)
if (player->spindash > chargingPoint)
{
// Time to release.
return 0;

View file

@ -23,6 +23,9 @@
// Made it as small as possible without making it look like the bots are twitching constantly.
#define BOTTURNCONFIRM 4
// How many tics without being able to accelerate before we'll let you spindash.
#define BOTSPINDASHCONFIRM (TICRATE/4)
// Point for bots to aim for
typedef struct botprediction_s {
fixed_t x, y;

View file

@ -64,7 +64,7 @@ static boolean K_BotUseItemNearPlayer(player_t *player, ticcmd_t *cmd, fixed_t r
if (target->mo == NULL || P_MobjWasRemoved(target->mo)
|| player == target || target->spectator
|| target->powers[pw_flashing])
|| target->flashing)
{
continue;
}
@ -117,7 +117,7 @@ static boolean K_PlayerNearSpot(player_t *player, fixed_t x, fixed_t y, fixed_t
if (target->mo == NULL || P_MobjWasRemoved(target->mo)
|| player == target || target->spectator
|| target->powers[pw_flashing])
|| target->flashing)
{
continue;
}
@ -190,7 +190,7 @@ static boolean K_PlayerInCone(player_t *player, fixed_t radius, UINT16 cone, boo
if (target->mo == NULL || P_MobjWasRemoved(target->mo)
|| player == target || target->spectator
|| target->powers[pw_flashing]
|| target->flashing
|| !P_CheckSight(player->mo, target->mo))
{
continue;
@ -354,7 +354,7 @@ static boolean K_BotRevealsGenericTrap(player_t *player, INT16 turnamt, boolean
--------------------------------------------------*/
static void K_BotItemGenericTrapShield(player_t *player, ticcmd_t *cmd, INT16 turnamt, boolean mine)
{
if (player->kartstuff[k_itemheld])
if (player->pflags & PF_ITEMOUT)
{
return;
}
@ -379,7 +379,7 @@ static void K_BotItemGenericTrapShield(player_t *player, ticcmd_t *cmd, INT16 tu
--------------------------------------------------*/
static void K_BotItemGenericOrbitShield(player_t *player, ticcmd_t *cmd)
{
if (player->kartstuff[k_itemheld])
if (player->pflags & PF_ITEMOUT)
{
return;
}
@ -401,13 +401,13 @@ static void K_BotItemGenericOrbitShield(player_t *player, ticcmd_t *cmd)
--------------------------------------------------*/
static void K_BotItemSneaker(player_t *player, ticcmd_t *cmd)
{
if ((player->kartstuff[k_offroad] && K_ApplyOffroad(player)) // Stuck in offroad, use it NOW
if ((player->offroad && K_ApplyOffroad(player)) // Stuck in offroad, use it NOW
|| K_GetWaypointIsShortcut(player->nextwaypoint) == true // Going toward a shortcut!
|| player->speed < K_GetKartSpeed(player, false)/2 // Being slowed down too much
|| player->kartstuff[k_speedboost] > (FRACUNIT/8) // Have another type of boost (tethering)
|| player->speedboost > (FRACUNIT/8) // Have another type of boost (tethering)
|| player->botvars.itemconfirm > 4*TICRATE) // Held onto it for too long
{
if (!player->kartstuff[k_sneakertimer] && !(player->pflags & PF_ATTACKDOWN))
if (!player->sneakertimer && !(player->pflags & PF_ATTACKDOWN))
{
cmd->buttons |= BT_ATTACK;
player->botvars.itemconfirm = 2*TICRATE;
@ -435,7 +435,7 @@ static void K_BotItemRocketSneaker(player_t *player, ticcmd_t *cmd)
{
if (player->botvars.itemconfirm > TICRATE)
{
if (!player->kartstuff[k_sneakertimer] && !(player->pflags & PF_ATTACKDOWN))
if (!player->sneakertimer && !(player->pflags & PF_ATTACKDOWN))
{
cmd->buttons |= BT_ATTACK;
player->botvars.itemconfirm = 0;
@ -487,7 +487,7 @@ static void K_BotItemBanana(player_t *player, ticcmd_t *cmd, INT16 turnamt)
throwdir = -1;
}
if (player->botvars.itemconfirm > 2*TICRATE || player->kartstuff[k_bananadrag] >= TICRATE)
if (player->botvars.itemconfirm > 2*TICRATE || player->bananadrag >= TICRATE)
{
K_BotGenericPressItem(player, cmd, throwdir);
}
@ -540,7 +540,7 @@ static void K_BotItemMine(player_t *player, ticcmd_t *cmd, INT16 turnamt)
if (player->botvars.itemconfirm > 2*TICRATE || player->kartstuff[k_bananadrag] >= TICRATE)
if (player->botvars.itemconfirm > 2*TICRATE || player->bananadrag >= TICRATE)
{
K_BotGenericPressItem(player, cmd, throwdir);
}
@ -577,13 +577,13 @@ static void K_BotItemEggman(player_t *player, ticcmd_t *cmd)
throwdir = -1;
}
if (stealth > 1 || player->kartstuff[k_itemroulette] > 0)
if (stealth > 1 || player->itemroulette > 0)
{
player->botvars.itemconfirm += player->botvars.difficulty * 4;
throwdir = -1;
}
if (player->botvars.itemconfirm > 2*TICRATE || player->kartstuff[k_bananadrag] >= TICRATE)
if (player->botvars.itemconfirm > 2*TICRATE || player->bananadrag >= TICRATE)
{
K_BotGenericPressItem(player, cmd, throwdir);
}
@ -639,7 +639,7 @@ static boolean K_BotRevealsEggbox(player_t *player)
--------------------------------------------------*/
static void K_BotItemEggmanShield(player_t *player, ticcmd_t *cmd)
{
if (player->kartstuff[k_eggmanheld])
if (player->pflags & PF_EGGMANOUT)
{
return;
}
@ -664,7 +664,7 @@ static void K_BotItemEggmanShield(player_t *player, ticcmd_t *cmd)
--------------------------------------------------*/
static void K_BotItemEggmanExplosion(player_t *player, ticcmd_t *cmd)
{
if (player->kartstuff[k_position] == 1)
if (player->position == 1)
{
cmd->forwardmove /= 2;
cmd->buttons |= BT_BRAKE;
@ -746,7 +746,7 @@ static void K_BotItemJawz(player_t *player, ticcmd_t *cmd)
throwdir = -1;
}
if (player->kartstuff[k_lastjawztarget] != -1)
if (player->lastjawztarget != -1)
{
player->botvars.itemconfirm += player->botvars.difficulty * 2;
throwdir = 1;
@ -801,13 +801,13 @@ static void K_BotItemBubble(player_t *player, ticcmd_t *cmd)
{
boolean hold = false;
if (player->kartstuff[k_bubbleblowup] <= 0)
if (player->bubbleblowup <= 0)
{
UINT8 i;
player->botvars.itemconfirm++;
if (player->kartstuff[k_bubblecool] <= 0)
if (player->bubblecool <= 0)
{
const fixed_t radius = 192 * player->mo->scale;
@ -825,7 +825,7 @@ static void K_BotItemBubble(player_t *player, ticcmd_t *cmd)
if (target->mo == NULL || P_MobjWasRemoved(target->mo)
|| player == target || target->spectator
|| target->powers[pw_flashing])
|| target->flashing)
{
continue;
}
@ -844,19 +844,19 @@ static void K_BotItemBubble(player_t *player, ticcmd_t *cmd)
}
}
}
else if (player->kartstuff[k_bubbleblowup] >= bubbletime)
else if (player->bubbleblowup >= bubbletime)
{
if (player->botvars.itemconfirm >= 10*TICRATE)
{
hold = true;
}
}
else if (player->kartstuff[k_bubbleblowup] < bubbletime)
else if (player->bubbleblowup < bubbletime)
{
hold = true;
}
if (hold && player->kartstuff[k_holdready])
if (hold && (player->pflags & PF_HOLDREADY))
{
cmd->buttons |= BT_ATTACK;
}
@ -880,11 +880,11 @@ static void K_BotItemFlame(player_t *player, ticcmd_t *cmd)
{
player->botvars.itemconfirm--;
}
else if (player->kartstuff[k_holdready])
else if (player->pflags & PF_HOLDREADY)
{
INT32 flamemax = player->kartstuff[k_flamelength] * flameseg;
INT32 flamemax = player->flamelength * flameseg;
if (player->kartstuff[k_flamemeter] < flamemax || flamemax == 0)
if (player->flamemeter < flamemax || flamemax == 0)
{
cmd->buttons |= BT_ATTACK;
}
@ -912,7 +912,7 @@ static void K_BotItemRings(player_t *player, ticcmd_t *cmd)
INT32 saferingsval = 16 - K_GetKartRingPower(player, false);
if (player->speed < K_GetKartSpeed(player, false)/2 // Being slowed down too much
|| player->kartstuff[k_speedboost] > (FRACUNIT/5)) // Have another type of boost (tethering)
|| player->speedboost > (FRACUNIT/5)) // Have another type of boost (tethering)
{
saferingsval -= 5;
}
@ -967,7 +967,7 @@ static void K_BotItemRouletteMash(player_t *player, ticcmd_t *cmd)
--------------------------------------------------*/
void K_BotItemUsage(player_t *player, ticcmd_t *cmd, INT16 turnamt)
{
if (player->kartstuff[k_userings] == 1)
if (player->pflags & PF_USERINGS)
{
// Use rings!
@ -985,33 +985,33 @@ void K_BotItemUsage(player_t *player, ticcmd_t *cmd, INT16 turnamt)
return;
}
if (player->kartstuff[k_itemroulette])
if (player->itemroulette)
{
// Mashing behaviors
K_BotItemRouletteMash(player, cmd);
return;
}
if (player->kartstuff[k_stealingtimer] == 0 && player->kartstuff[k_stolentimer] == 0)
if (player->stealingtimer == 0)
{
if (player->kartstuff[k_eggmanexplode])
if (player->eggmanexplode)
{
K_BotItemEggmanExplosion(player, cmd);
}
else if (player->kartstuff[k_eggmanheld])
else if (player->pflags & PF_EGGMANOUT)
{
K_BotItemEggman(player, cmd);
}
else if (player->kartstuff[k_rocketsneakertimer] > 0)
else if (player->rocketsneakertimer > 0)
{
K_BotItemRocketSneaker(player, cmd);
}
else
{
switch (player->kartstuff[k_itemtype])
switch (player->itemtype)
{
default:
if (player->kartstuff[k_itemtype] != KITEM_NONE)
if (player->itemtype != KITEM_NONE)
{
K_BotItemGenericTap(player, cmd);
}
@ -1027,7 +1027,7 @@ void K_BotItemUsage(player_t *player, ticcmd_t *cmd, INT16 turnamt)
K_BotItemGenericTap(player, cmd);
break;
case KITEM_ROCKETSNEAKER:
if (player->kartstuff[k_rocketsneakertimer] <= 0)
if (player->rocketsneakertimer <= 0)
{
K_BotItemGenericTap(player, cmd);
}
@ -1037,7 +1037,7 @@ void K_BotItemUsage(player_t *player, ticcmd_t *cmd, INT16 turnamt)
break;
case KITEM_BANANA:
case KITEM_LANDMINE:
if (!player->kartstuff[k_itemheld])
if (!(player->pflags & PF_ITEMOUT))
{
K_BotItemGenericTrapShield(player, cmd, turnamt, false);
}
@ -1050,11 +1050,11 @@ void K_BotItemUsage(player_t *player, ticcmd_t *cmd, INT16 turnamt)
K_BotItemEggmanShield(player, cmd);
break;
case KITEM_ORBINAUT:
if (!player->kartstuff[k_itemheld])
if (!(player->pflags & PF_ITEMOUT))
{
K_BotItemGenericOrbitShield(player, cmd);
}
else if (player->kartstuff[k_position] != 1) // Hold onto orbiting items when in 1st :)
else if (player->position != 1) // Hold onto orbiting items when in 1st :)
/* FALL-THRU */
case KITEM_BALLHOG:
{
@ -1062,17 +1062,17 @@ void K_BotItemUsage(player_t *player, ticcmd_t *cmd, INT16 turnamt)
}
break;
case KITEM_JAWZ:
if (!player->kartstuff[k_itemheld])
if (!(player->pflags & PF_ITEMOUT))
{
K_BotItemGenericOrbitShield(player, cmd);
}
else if (player->kartstuff[k_position] != 1) // Hold onto orbiting items when in 1st :)
else if (player->position != 1) // Hold onto orbiting items when in 1st :)
{
K_BotItemJawz(player, cmd);
}
break;
case KITEM_MINE:
if (!player->kartstuff[k_itemheld])
if (!(player->pflags & PF_ITEMOUT))
{
K_BotItemGenericTrapShield(player, cmd, turnamt, true);
}

View file

@ -322,7 +322,7 @@ static boolean K_FindBlockingWalls(line_t *line)
// set openrange, opentop, openbottom
P_LineOpening(line, globalsmuggle.botmo);
if (globalsmuggle.botmo->player->kartstuff[k_waterskip])
if (globalsmuggle.botmo->player->waterskip)
maxstep += maxstepmove;
if (P_MobjTouchingSectorSpecial(globalsmuggle.botmo, 1, 13, false))
@ -648,18 +648,18 @@ static boolean K_FindObjectsForNudging(mobj_t *thing)
break;
}
if ((RINGTOTAL(globalsmuggle.botmo->player) < 20 && !globalsmuggle.botmo->player->kartstuff[k_ringlock]
if ((RINGTOTAL(globalsmuggle.botmo->player) < 20 && !(globalsmuggle.botmo->player->pflags & PF_RINGLOCK)
&& P_CanPickupItem(globalsmuggle.botmo->player, 0))
&& !thing->extravalue1
&& (globalsmuggle.botmo->player->kartstuff[k_itemtype] != KITEM_THUNDERSHIELD))
&& (globalsmuggle.botmo->player->itemtype != KITEM_THUNDERSHIELD))
{
K_AddAttackObject(thing, side, (RINGTOTAL(globalsmuggle.botmo->player) < 3) ? 5 : 1);
}
break;
case MT_PLAYER:
if (thing->player
&& !thing->player->kartstuff[k_hyudorotimer]
&& !globalsmuggle.botmo->player->kartstuff[k_hyudorotimer])
&& !thing->player->hyudorotimer
&& !globalsmuggle.botmo->player->hyudorotimer)
{
// There REALLY ought to be a better way to handle this logic, right?!
// Squishing
@ -672,40 +672,40 @@ static boolean K_FindObjectsForNudging(mobj_t *thing)
}
// Invincibility
else if (K_PlayerAttackSteer(thing, side, 20,
globalsmuggle.botmo->player->kartstuff[k_invincibilitytimer],
thing->player->kartstuff[k_invincibilitytimer]
globalsmuggle.botmo->player->invincibilitytimer,
thing->player->invincibilitytimer
))
{
break;
}
// Thunder Shield
else if (K_PlayerAttackSteer(thing, side, 20,
globalsmuggle.botmo->player->kartstuff[k_itemtype] == KITEM_THUNDERSHIELD,
thing->player->kartstuff[k_itemtype] == KITEM_THUNDERSHIELD
globalsmuggle.botmo->player->itemtype == KITEM_THUNDERSHIELD,
thing->player->itemtype == KITEM_THUNDERSHIELD
))
{
break;
}
// Bubble Shield
else if (K_PlayerAttackSteer(thing, side, 20,
globalsmuggle.botmo->player->kartstuff[k_itemtype] == KITEM_BUBBLESHIELD,
thing->player->kartstuff[k_itemtype] == KITEM_BUBBLESHIELD
globalsmuggle.botmo->player->itemtype == KITEM_BUBBLESHIELD,
thing->player->itemtype == KITEM_BUBBLESHIELD
))
{
break;
}
// Flame Shield
else if (K_PlayerAttackSteer(thing, side, 20,
globalsmuggle.botmo->player->kartstuff[k_itemtype] == KITEM_FLAMESHIELD,
thing->player->kartstuff[k_itemtype] == KITEM_FLAMESHIELD
globalsmuggle.botmo->player->itemtype == KITEM_FLAMESHIELD,
thing->player->itemtype == KITEM_FLAMESHIELD
))
{
break;
}
// Has held item shield
else if (K_PlayerAttackSteer(thing, side, 20,
(globalsmuggle.botmo->player->kartstuff[k_itemheld] || globalsmuggle.botmo->player->kartstuff[k_eggmanheld]),
(thing->player->kartstuff[k_itemheld] || thing->player->kartstuff[k_eggmanheld])
(thing->player->pflags & (PF_ITEMOUT|PF_EGGMANOUT)),
(globalsmuggle.botmo->player->pflags & (PF_ITEMOUT|PF_EGGMANOUT))
))
{
break;

View file

@ -30,14 +30,14 @@ boolean K_OrbinautJawzCollide(mobj_t *t1, mobj_t *t2)
if (t2->player)
{
if ((t2->player->powers[pw_flashing] > 0 && t2->hitlag == 0)
if ((t2->player->flashing > 0 && t2->hitlag == 0)
&& !(t1->type == MT_ORBINAUT || t1->type == MT_JAWZ || t1->type == MT_JAWZ_DUD))
return true;
if (t2->player->kartstuff[k_hyudorotimer])
if (t2->player->hyudorotimer)
return true; // no interaction
if (t2->player->kartstuff[k_flamedash] && t2->player->kartstuff[k_itemtype] == KITEM_FLAMESHIELD)
if (t2->player->flamedash && t2->player->itemtype == KITEM_FLAMESHIELD)
{
// Melt item
S_StartSound(t2, sfx_s3k43);
@ -123,14 +123,14 @@ boolean K_BananaBallhogCollide(mobj_t *t1, mobj_t *t2)
if (t2->player)
{
if (t2->player->powers[pw_flashing] > 0 && t2->hitlag == 0)
if (t2->player->flashing > 0 && t2->hitlag == 0)
return true;
// Banana snipe!
if (t1->type == MT_BANANA && t1->health > 1)
S_StartSound(t2, sfx_bsnipe);
if (t2->player->kartstuff[k_flamedash] && t2->player->kartstuff[k_itemtype] == KITEM_FLAMESHIELD)
if (t2->player->flamedash && t2->player->itemtype == KITEM_FLAMESHIELD)
{
// Melt item
S_StartSound(t2, sfx_s3k43);
@ -206,23 +206,17 @@ boolean K_EggItemCollide(mobj_t *t1, mobj_t *t2)
if ((gametyperules & GTR_BUMPERS) && t2->player->bumpers <= 0)
{
#ifdef OTHERKARMAMODES
if (t2->player->kartstuff[k_comebackmode] || t2->player->karmadelay)
return true;
t2->player->kartstuff[k_comebackmode] = 2;
#else
return true;
#endif
}
else
{
K_DropItems(t2->player); //K_StripItems(t2->player);
//K_StripOther(t2->player);
t2->player->kartstuff[k_itemroulette] = 1;
t2->player->kartstuff[k_roulettetype] = 2;
t2->player->itemroulette = 1;
t2->player->roulettetype = 2;
}
if (t2->player->kartstuff[k_flamedash] && t2->player->kartstuff[k_itemtype] == KITEM_FLAMESHIELD)
if (t2->player->flamedash && t2->player->itemtype == KITEM_FLAMESHIELD)
{
// Melt item
S_StartSound(t2, sfx_s3k43);
@ -243,14 +237,14 @@ boolean K_EggItemCollide(mobj_t *t1, mobj_t *t2)
if (t1->target && t1->target->player)
{
if ((gametyperules & GTR_CIRCUIT) || t1->target->player->bumpers > 0)
t2->player->kartstuff[k_eggmanblame] = t1->target->player-players;
t2->player->eggmanblame = t1->target->player-players;
else
t2->player->kartstuff[k_eggmanblame] = t2->player-players;
t2->player->eggmanblame = t2->player-players;
if (t1->target->hnext == t1)
{
P_SetTarget(&t1->target->hnext, NULL);
t1->target->player->kartstuff[k_eggmanheld] = 0;
t1->target->player->pflags &= ~PF_EGGMANOUT;
}
}
@ -272,7 +266,7 @@ boolean K_MineCollide(mobj_t *t1, mobj_t *t2)
if (t2->player)
{
if (t2->player->powers[pw_flashing] > 0 && t2->hitlag == 0)
if (t2->player->flashing > 0 && t2->hitlag == 0)
return true;
// Bomb punting
@ -314,7 +308,7 @@ boolean K_MineExplosionCollide(mobj_t *t1, mobj_t *t2)
{
if (t2->player)
{
if (t2->player->powers[pw_flashing] > 0 && t2->hitlag == 0)
if (t2->player->flashing > 0 && t2->hitlag == 0)
return true;
if (t1->state == &states[S_MINEEXPLOSION1])
@ -345,14 +339,14 @@ boolean K_LandMineCollide(mobj_t *t1, mobj_t *t2)
if (t2->player)
{
if (t2->player->powers[pw_flashing])
if (t2->player->flashing)
return true;
// Banana snipe!
if (t1->health > 1)
S_StartSound(t2, sfx_bsnipe);
if (t2->player->kartstuff[k_flamedash] && t2->player->kartstuff[k_itemtype] == KITEM_FLAMESHIELD)
if (t2->player->flamedash && t2->player->itemtype == KITEM_FLAMESHIELD)
{
// Melt item
S_StartSound(t2, sfx_s3k43);
@ -409,7 +403,7 @@ boolean K_KitchenSinkCollide(mobj_t *t1, mobj_t *t2)
if (t2->player)
{
if (t2->player->powers[pw_flashing] > 0 && t2->hitlag == 0)
if (t2->player->flashing > 0 && t2->hitlag == 0)
return true;
S_StartSound(NULL, sfx_bsnipe); // let all players hear it.
@ -458,8 +452,8 @@ boolean K_SMKIceBlockCollide(mobj_t *t1, mobj_t *t2)
P_KillMobj(t1, t2, t2, DMG_NORMAL);
/*
if (t2->player && (t2->player->kartstuff[k_invincibilitytimer] > 0
|| t2->player->kartstuff[k_growshrinktimer] > 0))
if (t2->player && (t2->player->invincibilitytimer > 0
|| t2->player->growshrinktimer > 0))
return true;
*/
@ -489,8 +483,8 @@ boolean K_PvPTouchDamage(mobj_t *t1, mobj_t *t2)
}
// Invincibility damage
t1Condition = (t1->player->kartstuff[k_invincibilitytimer] > 0);
t2Condition = (t2->player->kartstuff[k_invincibilitytimer] > 0);
t1Condition = (t1->player->invincibilitytimer > 0);
t2Condition = (t2->player->invincibilitytimer > 0);
if (t1Condition == true && t2Condition == false)
{
@ -504,8 +498,8 @@ boolean K_PvPTouchDamage(mobj_t *t1, mobj_t *t2)
}
// Flame Shield dash damage
t1Condition = (t1->player->kartstuff[k_flamedash] > 0 && t1->player->kartstuff[k_itemtype] == KITEM_FLAMESHIELD);
t2Condition = (t2->player->kartstuff[k_flamedash] > 0 && t2->player->kartstuff[k_itemtype] == KITEM_FLAMESHIELD);
t1Condition = (t1->player->flamedash > 0 && t1->player->itemtype == KITEM_FLAMESHIELD);
t2Condition = (t2->player->flamedash > 0 && t2->player->itemtype == KITEM_FLAMESHIELD);
if (t1Condition == true && t2Condition == false)
{
@ -522,8 +516,8 @@ boolean K_PvPTouchDamage(mobj_t *t1, mobj_t *t2)
// (Pogo Spring damage is handled in head-stomping code)
if (gametyperules & GTR_BUMPERS)
{
t1Condition = (t1->player->kartstuff[k_sneakertimer] > 0 && t1->player->powers[pw_flashing] != 0);
t2Condition = (t2->player->kartstuff[k_sneakertimer] > 0 && t2->player->powers[pw_flashing] != 0);
t1Condition = (t1->player->sneakertimer > 0 && t1->player->flashing != 0);
t2Condition = (t2->player->sneakertimer > 0 && t2->player->flashing != 0);
if (t1Condition == true && t2Condition == false)
{
@ -538,8 +532,8 @@ boolean K_PvPTouchDamage(mobj_t *t1, mobj_t *t2)
}
// Ring sting, this is a bit more unique
t1Condition = (K_GetShieldFromItem(t2->player->kartstuff[k_itemtype]) == KSHIELD_NONE);
t2Condition = (K_GetShieldFromItem(t1->player->kartstuff[k_itemtype]) == KSHIELD_NONE);
t1Condition = (K_GetShieldFromItem(t2->player->itemtype) == KSHIELD_NONE);
t2Condition = (K_GetShieldFromItem(t1->player->itemtype) == KSHIELD_NONE);
if (t1Condition == true)
{

View file

@ -472,7 +472,7 @@ void K_IncreaseBotDifficulty(player_t *bot)
// Increment bot difficulty based on what position you were meant to come in!
expectedstanding = K_BotExpectedStanding(bot);
standingdiff = expectedstanding - bot->kartstuff[k_position];
standingdiff = expectedstanding - bot->position;
if (standingdiff >= -2)
{
@ -533,7 +533,7 @@ void K_FakeBotResults(player_t *bot)
if (besttime == UINT32_MAX // No one finished, so you don't finish either.
|| bot->distancetofinish >= worstdist) // Last place, you aren't going to finish.
{
bot->pflags |= PF_GAMETYPEOVER;
bot->pflags |= PF_NOCONTEST;
return;
}
@ -556,13 +556,13 @@ void K_PlayerLoseLife(player_t *player)
return;
}
if (player->spectator || player->exiting || player->bot || player->lostlife)
if (player->spectator || player->exiting || player->bot || (player->pflags & PF_LOSTLIFE))
{
return;
}
player->lives--;
player->lostlife = true;
player->pflags |= PF_LOSTLIFE;
#if 0
if (player->lives <= 0)

View file

@ -1045,7 +1045,7 @@ static void K_drawKartItem(void)
patch_t *localbg = ((offset) ? kp_itembg[2] : kp_itembg[0]);
patch_t *localinv = ((offset) ? kp_invincibility[((leveltime % (6*3)) / 3) + 7] : kp_invincibility[(leveltime % (7*3)) / 3]);
INT32 fx = 0, fy = 0, fflags = 0; // final coords for hud and flags...
const INT32 numberdisplaymin = ((!offset && stplyr->kartstuff[k_itemtype] == KITEM_ORBINAUT) ? 5 : 2);
const INT32 numberdisplaymin = ((!offset && stplyr->itemtype == KITEM_ORBINAUT) ? 5 : 2);
INT32 itembar = 0;
INT32 maxl = 0; // itembar's normal highest value
const INT32 barlength = (r_splitscreen > 1 ? 12 : 26);
@ -1054,12 +1054,12 @@ static void K_drawKartItem(void)
UINT8 *colmap = NULL;
boolean flipamount = false; // Used for 3P/4P splitscreen to flip item amount stuff
if (stplyr->kartstuff[k_itemroulette])
if (stplyr->itemroulette)
{
if (stplyr->skincolor)
localcolor = stplyr->skincolor;
switch((stplyr->kartstuff[k_itemroulette] % (15*3)) / 3)
switch((stplyr->itemroulette % (15*3)) / 3)
{
// Each case is handled in threes, to give three frames of in-game time to see the item on the roulette
case 0: // Sneaker
@ -1144,27 +1144,27 @@ static void K_drawKartItem(void)
// The only actual reason is to make sneakers line up this way in the code below
// This shouldn't have any actual baring over how it functions
// Hyudoro is first, because we're drawing it on top of the player's current item
if (stplyr->kartstuff[k_stolentimer] > 0)
if (stplyr->stealingtimer < 0)
{
if (leveltime & 2)
localpatch = kp_hyudoro[offset];
else
localpatch = kp_nodraw;
}
else if ((stplyr->kartstuff[k_stealingtimer] > 0) && (leveltime & 2))
else if ((stplyr->stealingtimer > 0) && (leveltime & 2))
{
localpatch = kp_hyudoro[offset];
}
else if (stplyr->kartstuff[k_eggmanexplode] > 1)
else if (stplyr->eggmanexplode > 1)
{
if (leveltime & 1)
localpatch = kp_eggman[offset];
else
localpatch = kp_nodraw;
}
else if (stplyr->kartstuff[k_rocketsneakertimer] > 1)
else if (stplyr->rocketsneakertimer > 1)
{
itembar = stplyr->kartstuff[k_rocketsneakertimer];
itembar = stplyr->rocketsneakertimer;
maxl = (itemtime*3) - barlength;
if (leveltime & 1)
@ -1172,7 +1172,7 @@ static void K_drawKartItem(void)
else
localpatch = kp_nodraw;
}
else if (stplyr->kartstuff[k_sadtimer] > 0)
else if (stplyr->sadtimer > 0)
{
if (leveltime & 2)
localpatch = kp_sadface[offset];
@ -1181,10 +1181,10 @@ static void K_drawKartItem(void)
}
else
{
if (stplyr->kartstuff[k_itemamount] <= 0)
if (stplyr->itemamount <= 0)
return;
switch(stplyr->kartstuff[k_itemtype])
switch(stplyr->itemtype)
{
case KITEM_SNEAKER:
localpatch = kp_sneaker[offset];
@ -1203,7 +1203,7 @@ static void K_drawKartItem(void)
localpatch = kp_eggman[offset];
break;
case KITEM_ORBINAUT:
localpatch = kp_orbinaut[(offset ? 4 : min(stplyr->kartstuff[k_itemamount]-1, 3))];
localpatch = kp_orbinaut[(offset ? 4 : min(stplyr->itemamount-1, 3))];
break;
case KITEM_JAWZ:
localpatch = kp_jawz[offset];
@ -1258,7 +1258,7 @@ static void K_drawKartItem(void)
return;
}
if (stplyr->kartstuff[k_itemheld] && !(leveltime & 1))
if ((stplyr->pflags & PF_ITEMOUT) && !(leveltime & 1))
localpatch = kp_nodraw;
}
@ -1311,19 +1311,19 @@ static void K_drawKartItem(void)
V_DrawScaledPatch(fx, fy, V_HUDTRANS|V_SLIDEIN|fflags, localbg);
// Then, the numbers:
if (stplyr->kartstuff[k_itemamount] >= numberdisplaymin && !stplyr->kartstuff[k_itemroulette])
if (stplyr->itemamount >= numberdisplaymin && !stplyr->itemroulette)
{
V_DrawScaledPatch(fx + (flipamount ? 48 : 0), fy, V_HUDTRANS|V_SLIDEIN|fflags|(flipamount ? V_FLIP : 0), kp_itemmulsticker[offset]); // flip this graphic for p2 and p4 in split and shift it.
V_DrawFixedPatch(fx<<FRACBITS, fy<<FRACBITS, FRACUNIT, V_HUDTRANS|V_SLIDEIN|fflags, localpatch, colmap);
if (offset)
if (flipamount) // reminder that this is for 3/4p's right end of the screen.
V_DrawString(fx+2, fy+31, V_ALLOWLOWERCASE|V_HUDTRANS|V_SLIDEIN|fflags, va("x%d", stplyr->kartstuff[k_itemamount]));
V_DrawString(fx+2, fy+31, V_ALLOWLOWERCASE|V_HUDTRANS|V_SLIDEIN|fflags, va("x%d", stplyr->itemamount));
else
V_DrawString(fx+24, fy+31, V_ALLOWLOWERCASE|V_HUDTRANS|V_SLIDEIN|fflags, va("x%d", stplyr->kartstuff[k_itemamount]));
V_DrawString(fx+24, fy+31, V_ALLOWLOWERCASE|V_HUDTRANS|V_SLIDEIN|fflags, va("x%d", stplyr->itemamount));
else
{
V_DrawScaledPatch(fy+28, fy+41, V_HUDTRANS|V_SLIDEIN|fflags, kp_itemx);
V_DrawKartString(fx+38, fy+36, V_HUDTRANS|V_SLIDEIN|fflags, va("%d", stplyr->kartstuff[k_itemamount]));
V_DrawKartString(fx+38, fy+36, V_HUDTRANS|V_SLIDEIN|fflags, va("%d", stplyr->itemamount));
}
}
else
@ -1351,17 +1351,17 @@ static void K_drawKartItem(void)
}
// Quick Eggman numbers
if (stplyr->kartstuff[k_eggmanexplode] > 1 /*&& stplyr->kartstuff[k_eggmanexplode] <= 3*TICRATE*/)
V_DrawScaledPatch(fx+17, fy+13-offset, V_HUDTRANS|V_SLIDEIN|fflags, kp_eggnum[min(3, G_TicsToSeconds(stplyr->kartstuff[k_eggmanexplode]))]);
if (stplyr->eggmanexplode > 1)
V_DrawScaledPatch(fx+17, fy+13-offset, V_HUDTRANS|V_SLIDEIN|fflags, kp_eggnum[min(3, G_TicsToSeconds(stplyr->eggmanexplode))]);
if (stplyr->kartstuff[k_itemtype] == KITEM_FLAMESHIELD && stplyr->kartstuff[k_flamelength] > 0)
if (stplyr->itemtype == KITEM_FLAMESHIELD && stplyr->flamelength > 0)
{
INT32 numframes = 104;
INT32 absolutemax = 16 * flameseg;
INT32 flamemax = stplyr->kartstuff[k_flamelength] * flameseg;
INT32 flamemeter = min(stplyr->kartstuff[k_flamemeter], flamemax);
INT32 flamemax = stplyr->flamelength * flameseg;
INT32 flamemeter = min(stplyr->flamemeter, flamemax);
INT32 bf = 16 - stplyr->kartstuff[k_flamelength];
INT32 bf = 16 - stplyr->flamelength;
INT32 ff = numframes - ((flamemeter * numframes) / absolutemax);
INT32 fmin = (8 * (bf-1));
@ -1385,9 +1385,9 @@ static void K_drawKartItem(void)
if (bf >= 0 && bf < 16)
V_DrawScaledPatch(fx-xo, fy-yo, V_HUDTRANS|V_SLIDEIN|fflags|flip, kp_flameshieldmeter_bg[bf][offset]);
if (ff >= 0 && ff < numframes && stplyr->kartstuff[k_flamemeter] > 0)
if (ff >= 0 && ff < numframes && stplyr->flamemeter > 0)
{
if ((stplyr->kartstuff[k_flamemeter] > flamemax) && (leveltime & 1))
if ((stplyr->flamemeter > flamemax) && (leveltime & 1))
{
UINT8 *fsflash = R_GetTranslationColormap(TC_BLINK, SKINCOLOR_WHITE, GTC_CACHE);
V_DrawMappedPatch(fx-xo, fy-yo, V_HUDTRANS|V_SLIDEIN|fflags|flip, kp_flameshieldmeter[ff][offset], fsflash);
@ -1572,7 +1572,7 @@ static void K_DrawKartPositionNum(INT32 num)
addOrSub = V_SUBTRACT;
}
if (stplyr->kartstuff[k_positiondelay] || stplyr->exiting)
if (stplyr->positiondelay || stplyr->exiting)
{
scale *= 2;
overtake = true; // this is used for splitscreen stuff in conjunction with flipdraw.
@ -1735,11 +1735,11 @@ static boolean K_drawKartPositionFaces(void)
if (completed[i] || !playeringame[i] || players[i].spectator || !players[i].mo)
continue;
if (players[i].kartstuff[k_position] >= lowestposition)
if (players[i].position >= lowestposition)
continue;
rankplayer[ranklines] = i;
lowestposition = players[i].kartstuff[k_position];
lowestposition = players[i].position;
}
i = rankplayer[ranklines];
@ -1816,7 +1816,7 @@ static boolean K_drawKartPositionFaces(void)
UINT32 emeraldFlag = (1 << j);
UINT16 emeraldColor = SKINCOLOR_CHAOSEMERALD1 + j;
if (players[rankplayer[i]].powers[pw_emeralds] & emeraldFlag)
if (players[rankplayer[i]].emeralds & emeraldFlag)
{
colormap = R_GetTranslationColormap(TC_DEFAULT, emeraldColor, GTC_CACHE);
V_DrawMappedPatch(emeraldx, Y+7, V_HUDTRANS|V_SLIDEIN|V_SNAPTOLEFT, kp_rankemerald, colormap);
@ -1831,7 +1831,7 @@ static boolean K_drawKartPositionFaces(void)
V_DrawScaledPatch(FACE_X-4, Y-3, V_HUDTRANS|V_SLIDEIN|V_SNAPTOLEFT, kp_ranknobumpers);
else
{
INT32 pos = players[rankplayer[i]].kartstuff[k_position];
INT32 pos = players[rankplayer[i]].position;
if (pos < 0 || pos > MAXPLAYERS)
pos = 0;
// Draws the little number over the face
@ -1868,7 +1868,7 @@ static void K_drawKartEmeralds(void)
UINT32 emeraldFlag = (1 << i);
UINT16 emeraldColor = SKINCOLOR_CHAOSEMERALD1 + i;
if (stplyr->powers[pw_emeralds] & emeraldFlag)
if (stplyr->emeralds & emeraldFlag)
{
boolean whiteFlash = (leveltime & 1);
UINT8 *colormap;
@ -1997,7 +1997,7 @@ void K_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, IN
V_DrawScaledPatch(x-4, y-7, 0, kp_ranknobumpers);
else
{
INT32 pos = players[tab[i].num].kartstuff[k_position];
INT32 pos = players[tab[i].num].position;
if (pos < 0 || pos > MAXPLAYERS)
pos = 0;
// Draws the little number over the face
@ -2011,7 +2011,7 @@ void K_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, IN
{
if (players[tab[i].num].exiting)
V_DrawRightAlignedThinString(x+rightoffset, y-1, hilicol|V_6WIDTHSPACE, timestring(players[tab[i].num].realtime));
else if (players[tab[i].num].pflags & PF_GAMETYPEOVER)
else if (players[tab[i].num].pflags & PF_NOCONTEST)
V_DrawRightAlignedThinString(x+rightoffset, y-1, V_6WIDTHSPACE, "NO CONTEST.");
else if (circuitmap)
V_DrawRightAlignedThinString(x+rightoffset, y-1, V_6WIDTHSPACE, va("Lap %d", tab[i].count));
@ -2020,7 +2020,7 @@ void K_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, IN
{
if (players[tab[i].num].exiting)
V_DrawRightAlignedString(x+rightoffset, y, hilicol, timestring(players[tab[i].num].realtime));
else if (players[tab[i].num].pflags & PF_GAMETYPEOVER)
else if (players[tab[i].num].pflags & PF_NOCONTEST)
V_DrawRightAlignedThinString(x+rightoffset, y-1, 0, "NO CONTEST.");
else if (circuitmap)
V_DrawRightAlignedString(x+rightoffset, y, 0, va("Lap %d", tab[i].count));
@ -2146,7 +2146,7 @@ static void K_drawKartLapsAndRings(void)
V_DrawMappedPatch(fr+15, fy-10, V_HUDTRANS|V_SLIDEIN|splitflags, fontv[PINGNUM_FONT].font[rn[1]], ringmap);
// SPB ring lock
if (stplyr->kartstuff[k_ringlock])
if (stplyr->pflags & PF_RINGLOCK)
V_DrawScaledPatch(fr-12, fy-23, V_HUDTRANS|V_SLIDEIN|splitflags, kp_ringspblocksmall[stplyr->karthud[khud_ringspblock]]);
// Lives
@ -2184,7 +2184,7 @@ static void K_drawKartLapsAndRings(void)
}
// SPB ring lock
if (stplyr->kartstuff[k_ringlock])
if (stplyr->pflags & PF_RINGLOCK)
V_DrawScaledPatch(LAPS_X-5, LAPS_Y-28, V_HUDTRANS|V_SLIDEIN|splitflags, kp_ringspblock[stplyr->karthud[khud_ringspblock]]);
// Lives
@ -2602,16 +2602,16 @@ static void K_drawKartPlayerCheck(void)
continue;
}
if ((checkplayer->kartstuff[k_invincibilitytimer] <= 0) && (leveltime & 2))
if ((checkplayer->invincibilitytimer <= 0) && (leveltime & 2))
{
pnum++; // white frames
}
if (checkplayer->kartstuff[k_itemtype] == KITEM_GROW || checkplayer->kartstuff[k_growshrinktimer] > 0)
if (checkplayer->itemtype == KITEM_GROW || checkplayer->growshrinktimer > 0)
{
pnum += 4;
}
else if (checkplayer->kartstuff[k_itemtype] == KITEM_INVINCIBILITY || checkplayer->kartstuff[k_invincibilitytimer])
else if (checkplayer->itemtype == KITEM_INVINCIBILITY || checkplayer->invincibilitytimer)
{
pnum += 2;
}
@ -2645,8 +2645,8 @@ static boolean K_ShowPlayerNametag(player_t *p)
if (gametyperules & GTR_CIRCUIT)
{
if ((p->kartstuff[k_position] < stplyr->kartstuff[k_position]-2)
|| (p->kartstuff[k_position] > stplyr->kartstuff[k_position]+2))
if ((p->position < stplyr->position-2)
|| (p->position > stplyr->position+2))
{
return false;
}
@ -3144,10 +3144,10 @@ static void K_drawKartMinimap(void)
if (gametype == GT_BATTLE && players[i].bumpers <= 0)
continue;
if (players[i].kartstuff[k_hyudorotimer] > 0)
if (players[i].hyudorotimer > 0)
{
if (!((players[i].kartstuff[k_hyudorotimer] < TICRATE/2
|| players[i].kartstuff[k_hyudorotimer] > hyu-(TICRATE/2))
if (!((players[i].hyudorotimer < TICRATE/2
|| players[i].hyudorotimer > hyu-(TICRATE/2))
&& !(leveltime & 1)))
continue;
}
@ -3178,7 +3178,7 @@ static void K_drawKartMinimap(void)
K_drawKartMinimapIcon(players[i].mo->x, players[i].mo->y, x, y, splitflags, faceprefix[skin][FACE_MINIMAP], colormap, AutomapPic);
// Target reticule
if ((gametype == GT_RACE && players[i].kartstuff[k_position] == spbplace)
if ((gametype == GT_RACE && players[i].position == spbplace)
|| (gametype == GT_BATTLE && K_IsPlayerWanted(&players[i])))
K_drawKartMinimapIcon(players[i].mo->x, players[i].mo->y, x, y, splitflags, kp_wantedreticle, NULL, AutomapPic);
}
@ -3231,7 +3231,7 @@ static void K_drawKartMinimap(void)
K_drawKartMinimapIcon(players[localplayers[i]].mo->x, players[localplayers[i]].mo->y, x, y, splitflags, faceprefix[skin][FACE_MINIMAP], colormap, AutomapPic);
// Target reticule
if ((gametype == GT_RACE && players[localplayers[i]].kartstuff[k_position] == spbplace)
if ((gametype == GT_RACE && players[localplayers[i]].position == spbplace)
|| (gametype == GT_BATTLE && K_IsPlayerWanted(&players[localplayers[i]])))
K_drawKartMinimapIcon(players[localplayers[i]].mo->x, players[localplayers[i]].mo->y, x, y, splitflags, kp_wantedreticle, NULL, AutomapPic);
}
@ -3569,7 +3569,7 @@ static void K_drawBattleFullscreen(void)
if (K_IsPlayerLosing(stplyr))
p = kp_battlelose;
else if (stplyr->kartstuff[k_position] == 1)
else if (stplyr->position == 1)
p = kp_battlewin;
V_DrawFixedPatch(x<<FRACBITS, y<<FRACBITS, scale, splitflags, p, NULL);
@ -3706,8 +3706,8 @@ static void K_drawKartFirstPerson(void)
if (tn != stplyr->steering/50)
tn -= (tn - (stplyr->steering/50))/8;
if (dr != stplyr->kartstuff[k_drift]*16)
dr -= (dr - (stplyr->kartstuff[k_drift]*16))/8;
if (dr != stplyr->drift*16)
dr -= (dr - (stplyr->drift*16))/8;
if (r_splitscreen == 1)
{
@ -3721,7 +3721,7 @@ static void K_drawKartFirstPerson(void)
if (stplyr->mo)
{
UINT8 driftcolor = K_DriftSparkColor(stplyr, stplyr->kartstuff[k_driftcharge]);
UINT8 driftcolor = K_DriftSparkColor(stplyr, stplyr->driftcharge);
const angle_t ang = R_PointToAngle2(0, 0, stplyr->rmomx, stplyr->rmomy) - stplyr->drawangle;
// yes, the following is correct. no, you do not need to swap the x and y.
fixed_t xoffs = -P_ReturnThrustY(stplyr->mo, ang, (BASEVIDWIDTH<<(FRACBITS-2))/2);
@ -4054,7 +4054,7 @@ static void K_drawDistributionDebugger(void)
for (i = 0; i < MAXPLAYERS; i++)
{
if (playeringame[i] && !players[i].spectator
&& players[i].kartstuff[k_position] == 1)
&& players[i].position == 1)
{
// This player is first! Yay!
pdis = stplyr->distancetofinish - players[i].distancetofinish;
@ -4065,7 +4065,7 @@ static void K_drawDistributionDebugger(void)
if (franticitems) // Frantic items make the distances between everyone artifically higher, for crazier items
pdis = (15 * pdis) / 14;
if (spbplace != -1 && stplyr->kartstuff[k_position] == spbplace+1) // SPB Rush Mode: It's 2nd place's job to catch-up items and make 1st place's job hell
if (spbplace != -1 && stplyr->position == spbplace+1) // SPB Rush Mode: It's 2nd place's job to catch-up items and make 1st place's job hell
{
pdis = (3 * pdis) / 2;
spbrush = true;
@ -4172,7 +4172,7 @@ void K_drawKartHUD(void)
&& (stplyr->exiting
|| (stplyr->bumpers <= 0
&& stplyr->karmadelay > 0
&& stplyr->eliminated == false
&& !(stplyr->pflags & PF_ELIMINATED)
&& comeback == true
&& stplyr->playerstate == PST_LIVE)));
@ -4255,7 +4255,7 @@ void K_drawKartHUD(void)
{
// Draw the numerical position
if (LUA_HudEnabled(hud_position))
K_DrawKartPositionNum(stplyr->kartstuff[k_position]);
K_DrawKartPositionNum(stplyr->position);
}
else //if (!(demo.playback && hu_showscores))
{
@ -4328,7 +4328,7 @@ void K_drawKartHUD(void)
K_drawKartFreePlay();
}
if (r_splitscreen == 0 && stplyr->kartstuff[k_wrongway] && ((leveltime / 8) & 1))
if (r_splitscreen == 0 && (stplyr->pflags & PF_WRONGWAY) && ((leveltime / 8) & 1))
{
V_DrawCenteredString(BASEVIDWIDTH>>1, 176, V_REDMAP|V_SNAPTOBOTTOM, "WRONG WAY");
}

File diff suppressed because it is too large Load diff

View file

@ -86,7 +86,9 @@ void K_UpdateSteeringValue(player_t *player, INT16 destSteering);
INT16 K_GetKartTurnValue(player_t *player, INT16 turnvalue);
INT32 K_GetKartDriftSparkValue(player_t *player);
INT32 K_StairJankFlip(INT32 value);
INT32 K_GetKartDriftSparkValueForStage(player_t *player, UINT8 stage);
void K_SpawnDriftBoostExplosion(player_t *player, int stage);
void K_SpawnDriftElectricSparks(player_t *player);
void K_KartUpdatePosition(player_t *player);
mobj_t *K_CreatePaperItem(fixed_t x, fixed_t y, fixed_t z, angle_t angle, SINT8 flip, UINT8 type, UINT8 amount);
void K_DropItems(player_t *player);
@ -106,6 +108,7 @@ UINT16 K_GetKartFlashing(player_t *player);
boolean K_KartKickstart(player_t *player);
UINT16 K_GetKartButtons(player_t *player);
SINT8 K_GetForwardMove(player_t *player);
fixed_t K_GetNewSpeed(player_t *player);
fixed_t K_3dKartMovement(player_t *player);
boolean K_PlayerEBrake(player_t *player);
SINT8 K_Sliptiding(player_t *player);

View file

@ -113,7 +113,7 @@ static void K_RespawnAtWaypoint(player_t *player, waypoint_t *waypoint)
void K_DoFault(player_t *player)
{
player->powers[pw_nocontrol] = (starttime - leveltime) + 50;
player->nocontrol = (starttime - leveltime) + 50;
if (!(player->pflags & PF_FAULT))
{
S_StartSound(player->mo, sfx_s3k83);
@ -149,14 +149,14 @@ void K_DoIngameRespawn(player_t *player)
if (leveltime < starttime)
K_DoFault(player);
player->kartstuff[k_ringboost] = 0;
player->kartstuff[k_driftboost] = 0;
player->ringboost = 0;
player->driftboost = player->strongdriftboost = 0;
// If player was tumbling, set variables so that they don't tumble like crazy after they're done respawning
if (player->tumbleBounces > 0)
{
player->tumbleBounces = TUMBLEBOUNCES-1; // Max # of bounces-1 (so you still tumble once)
player->tumbleLastBounce = false; // Still force them to bounce at least once for the funny
player->pflags &= ~PF_TUMBLELASTBOUNCE; // Still force them to bounce at least once for the funny
players->tumbleHeight = 20; // force tumble height
}
@ -329,8 +329,8 @@ static void K_MovePlayerToRespawnPoint(player_t *player)
player->mo->momx = player->mo->momy = player->mo->momz = 0;
player->powers[pw_flashing] = 2;
player->powers[pw_nocontrol] = max(2, player->powers[pw_nocontrol]);
player->flashing = 2;
player->nocontrol = max(2, player->nocontrol);
if (leveltime % 8 == 0 && !mapreset)
{
@ -589,7 +589,7 @@ static void K_MovePlayerToRespawnPoint(player_t *player)
--------------------------------------------------*/
static void K_DropDashWait(player_t *player)
{
if (player->powers[pw_nocontrol] == 0)
if (player->nocontrol == 0)
player->respawn.timer--;
if (leveltime % 8 == 0)
@ -656,7 +656,7 @@ static void K_HandleDropDash(player_t *player)
{
const UINT16 buttons = K_GetKartButtons(player);
if (player->kartstuff[k_growshrinktimer] < 0)
if (player->growshrinktimer < 0)
{
player->mo->scalespeed = mapobjectscale/TICRATE;
player->mo->destscale = (6*mapobjectscale)/8;
@ -674,12 +674,12 @@ static void K_HandleDropDash(player_t *player)
return;
}
player->powers[pw_flashing] = K_GetKartFlashing(player);
player->flashing = K_GetKartFlashing(player);
// The old behavior was stupid and prone to accidental usage.
// Let's rip off Mania instead, and turn this into a Drop Dash!
if ((buttons & BT_ACCELERATE) && !player->kartstuff[k_spinouttimer]) // Since we're letting players spin out on respawn, don't let them charge a dropdash in this state. (It wouldn't work anyway)
if ((buttons & BT_ACCELERATE) && !player->spinouttimer) // Since we're letting players spin out on respawn, don't let them charge a dropdash in this state. (It wouldn't work anyway)
{
player->respawn.dropdash++;
}
@ -707,7 +707,7 @@ static void K_HandleDropDash(player_t *player)
if ((buttons & BT_ACCELERATE) && (player->respawn.dropdash >= TICRATE/4))
{
S_StartSound(player->mo, sfx_s23c);
player->kartstuff[k_startboost] = 50;
player->startboost = 50;
K_SpawnDashDustRelease(player);
}

View file

@ -17,9 +17,9 @@
#define RESPAWN_DIST 1024
#define RESPAWN_TIME 48
#define RESPAWNST_NONE 0
#define RESPAWNST_MOVE 1
#define RESPAWNST_DROP 2
#define RESPAWNST_NONE 0x00
#define RESPAWNST_MOVE 0x01
#define RESPAWNST_DROP 0x02
/*--------------------------------------------------
fixed_t K_RespawnOffset(player_t *player, boolean flip);

View file

@ -170,7 +170,6 @@ static const struct {
{META_PLAYER, "player_t"},
{META_TICCMD, "ticcmd_t"},
{META_SKIN, "skin_t"},
{META_POWERS, "player_t.powers"},
{META_SOUNDSID, "skin_t.soundsid"},
{META_SKINSPRITES, "skin_t.sprites"},
{META_SKINSPRITESLIST, "skin_t.sprites[]"},
@ -1245,17 +1244,6 @@ static int lib_pRestoreMusic(lua_State *L)
return 1;
}
static int lib_pSpawnShieldOrb(lua_State *L)
{
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
NOHUD
INLEVEL
if (!player)
return LUA_ErrInvalid(L, "player_t");
P_SpawnShieldOrb(player);
return 0;
}
static int lib_pSpawnGhostMobj(lua_State *L)
{
mobj_t *mobj = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
@ -1291,17 +1279,6 @@ static int lib_pGivePlayerLives(lua_State *L)
return 0;
}
static int lib_pResetScore(lua_State *L)
{
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
NOHUD
INLEVEL
if (!player)
return LUA_ErrInvalid(L, "player_t");
P_ResetScore(player);
return 0;
}
static int lib_pMovePlayer(lua_State *L)
{
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
@ -1376,18 +1353,6 @@ static int lib_pNukeEnemies(lua_State *L)
return 0;
}
static int lib_pSwitchShield(lua_State *L)
{
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
UINT16 shield = luaL_checkinteger(L, 2);
NOHUD
INLEVEL
if (!player)
return LUA_ErrInvalid(L, "player_t");
P_SwitchShield(player, shield);
return 0;
}
// P_MAP
///////////
@ -3847,18 +3812,15 @@ static luaL_Reg lib[] = {
{"P_PlayJingle",lib_pPlayJingle},
{"P_PlayJingleMusic",lib_pPlayJingleMusic},
{"P_RestoreMusic",lib_pRestoreMusic},
{"P_SpawnShieldOrb",lib_pSpawnShieldOrb},
{"P_SpawnGhostMobj",lib_pSpawnGhostMobj},
{"P_GivePlayerRings",lib_pGivePlayerRings},
{"P_GivePlayerLives",lib_pGivePlayerLives},
{"P_ResetScore",lib_pResetScore},
{"P_MovePlayer",lib_pMovePlayer},
{"P_DoPlayerExit",lib_pDoPlayerExit},
{"P_InstaThrust",lib_pInstaThrust},
{"P_ReturnThrustX",lib_pReturnThrustX},
{"P_ReturnThrustY",lib_pReturnThrustY},
{"P_NukeEnemies",lib_pNukeEnemies},
{"P_SwitchShield",lib_pSwitchShield},
// p_map
{"P_CheckPosition",lib_pCheckPosition},

View file

@ -114,8 +114,6 @@ boolean LUAh_PlayerCmd(player_t *player, ticcmd_t *cmd); // Allows to write to p
void LUAh_IntermissionThinker(void); // Hook for Y_Ticker
void LUAh_VoteThinker(void); // Hook for Y_VoteTicker
#define LUAh_ShieldSpawn(player) LUAh_PlayerHook(player, hook_ShieldSpawn) // Hook for P_SpawnShieldOrb
#define LUAh_ShieldSpecial(player) LUAh_PlayerHook(player, hook_ShieldSpecial) // Hook for shield abilities
#define LUAh_MobjMoveBlocked(mo) LUAh_MobjHook(mo, hook_MobjMoveBlocked) // Hook for P_XYMovement (when movement is blocked)
boolean LUAh_MapThingSpawn(mobj_t *mo, mapthing_t *mthing); // Hook for P_SpawnMapThing by mobj type
boolean LUAh_FollowMobj(player_t *player, mobj_t *mobj); // Hook for P_PlayerAfterThink Smiles mobj-following

View file

@ -37,8 +37,6 @@ extern lua_State *gL;
#define META_PLAYER "PLAYER_T*"
#define META_TICCMD "TICCMD_T*"
#define META_SKIN "SKIN_T*"
#define META_POWERS "PLAYER_T*POWERS"
#define META_KARTSTUFF "PLAYER_T*KARTSTUFF"
#define META_KARTHUD "PLAYER_T*KARTHUD"
#define META_RESPAWN "PLAYER_T*RESPAWN"
#define META_COLLIDE "PLAYER_T*COLLIDE"

View file

@ -206,42 +206,170 @@ static int player_get(lua_State *L)
lua_pushangle(L, plr->aiming);
else if (fastcmp(field,"drawangle"))
lua_pushangle(L, plr->drawangle);
else if (fastcmp(field,"rings"))
lua_pushinteger(L, plr->rings);
else if (fastcmp(field,"spheres"))
lua_pushinteger(L, plr->spheres);
else if (fastcmp(field,"powers"))
LUA_PushUserdata(L, plr->powers, META_POWERS);
else if (fastcmp(field,"kartstuff"))
LUA_PushUserdata(L, plr->kartstuff, META_KARTSTUFF);
else if (fastcmp(field,"karthud"))
LUA_PushUserdata(L, plr->karthud, META_KARTHUD);
else if (fastcmp(field,"nocontrol"))
lua_pushinteger(L, plr->nocontrol);
else if (fastcmp(field,"carry"))
lua_pushinteger(L, plr->carry);
else if (fastcmp(field,"dye"))
lua_pushinteger(L, plr->dye);
else if (fastcmp(field,"position"))
lua_pushinteger(L, plr->position);
else if (fastcmp(field,"oldposition"))
lua_pushinteger(L, plr->oldposition);
else if (fastcmp(field,"positiondelay"))
lua_pushinteger(L, plr->positiondelay);
else if (fastcmp(field,"distancetofinish"))
lua_pushinteger(L, plr->distancetofinish);
else if (fastcmp(field,"airtime"))
lua_pushinteger(L, plr->airtime);
else if (fastcmp(field,"driftInput"))
lua_pushboolean(L, plr->driftInput);
else if (fastcmp(field,"airFailsafe"))
lua_pushboolean(L, plr->airFailsafe);
else if (fastcmp(field,"flashing"))
lua_pushinteger(L, plr->flashing);
else if (fastcmp(field,"spinouttimer"))
lua_pushinteger(L, plr->spinouttimer);
else if (fastcmp(field,"instashield"))
lua_pushinteger(L, plr->instashield);
else if (fastcmp(field,"wipeoutslow"))
lua_pushinteger(L, plr->wipeoutslow);
else if (fastcmp(field,"justbumped"))
lua_pushinteger(L, plr->justbumped);
else if (fastcmp(field,"tumbleBounces"))
lua_pushinteger(L, plr->tumbleBounces);
else if (fastcmp(field,"tumbleHeight"))
lua_pushinteger(L, plr->tumbleHeight);
else if (fastcmp(field,"tumbleLastBounce"))
lua_pushboolean(L, plr->tumbleLastBounce);
else if (fastcmp(field,"tumbleSound"))
lua_pushboolean(L, plr->tumbleSound);
else if (fastcmp(field,"drift"))
lua_pushinteger(L, plr->drift);
else if (fastcmp(field,"driftcharge"))
lua_pushinteger(L, plr->driftcharge);
else if (fastcmp(field,"driftboost"))
lua_pushinteger(L, plr->driftboost);
else if (fastcmp(field,"strongdriftboost"))
lua_pushinteger(L, plr->strongdriftboost);
else if (fastcmp(field,"aizdriftstraft"))
lua_pushinteger(L, plr->aizdriftstrat);
else if (fastcmp(field,"aizdrifttilt"))
lua_pushinteger(L, plr->aizdrifttilt);
else if (fastcmp(field,"aizdriftturn"))
lua_pushinteger(L, plr->aizdriftturn);
else if (fastcmp(field,"offroad"))
lua_pushinteger(L, plr->offroad);
else if (fastcmp(field,"waterskip"))
lua_pushinteger(L, plr->waterskip);
else if (fastcmp(field,"tiregrease"))
lua_pushinteger(L, plr->tiregrease);
else if (fastcmp(field,"springstars"))
lua_pushinteger(L, plr->springstars);
else if (fastcmp(field,"springcolor"))
lua_pushinteger(L, plr->springcolor);
else if (fastcmp(field,"dashpadcooldown"))
lua_pushinteger(L, plr->dashpadcooldown);
else if (fastcmp(field,"spindash"))
lua_pushinteger(L, plr->spindash);
else if (fastcmp(field,"spindashspeed"))
lua_pushinteger(L, plr->spindashspeed);
else if (fastcmp(field,"spindashboost"))
lua_pushinteger(L, plr->spindashboost);
else if (fastcmp(field,"numboosts"))
lua_pushinteger(L, plr->numboosts);
else if (fastcmp(field,"boostpower"))
lua_pushinteger(L, plr->boostpower);
else if (fastcmp(field,"speedboost"))
lua_pushinteger(L, plr->speedboost);
else if (fastcmp(field,"accelboost"))
lua_pushinteger(L, plr->accelboost);
else if (fastcmp(field,"handleboost"))
lua_pushinteger(L, plr->handleboost);
else if (fastcmp(field,"boostangle"))
lua_pushinteger(L, plr->boostangle);
else if (fastcmp(field,"draftpower"))
lua_pushinteger(L, plr->draftpower);
else if (fastcmp(field,"draftleeway"))
lua_pushinteger(L, plr->draftleeway);
else if (fastcmp(field,"lastdraft"))
lua_pushinteger(L, plr->lastdraft);
else if (fastcmp(field,"itemroulette"))
lua_pushinteger(L, plr->itemroulette);
else if (fastcmp(field,"roulettetype"))
lua_pushinteger(L, plr->roulettetype);
else if (fastcmp(field,"itemtype"))
lua_pushinteger(L, plr->itemtype);
else if (fastcmp(field,"itemamount"))
lua_pushinteger(L, plr->itemamount);
else if (fastcmp(field,"throwdir"))
lua_pushinteger(L, plr->throwdir);
else if (fastcmp(field,"sadtimer"))
lua_pushinteger(L, plr->sadtimer);
else if (fastcmp(field,"rings"))
lua_pushinteger(L, plr->rings);
else if (fastcmp(field,"pickuprings"))
lua_pushinteger(L, plr->pickuprings);
else if (fastcmp(field,"ringdelay"))
lua_pushinteger(L, plr->ringdelay);
else if (fastcmp(field,"ringboost"))
lua_pushinteger(L, plr->ringboost);
else if (fastcmp(field,"sparkleanim"))
lua_pushinteger(L, plr->sparkleanim);
else if (fastcmp(field,"superring"))
lua_pushinteger(L, plr->superring);
else if (fastcmp(field,"curshield"))
lua_pushinteger(L, plr->curshield);
else if (fastcmp(field,"bubblecool"))
lua_pushinteger(L, plr->bubblecool);
else if (fastcmp(field,"bubbleblowup"))
lua_pushinteger(L, plr->bubbleblowup);
else if (fastcmp(field,"flamedash"))
lua_pushinteger(L, plr->flamedash);
else if (fastcmp(field,"flamemeter"))
lua_pushinteger(L, plr->flamemeter);
else if (fastcmp(field,"flamelength"))
lua_pushinteger(L, plr->flamelength);
else if (fastcmp(field,"hyudorotimer"))
lua_pushinteger(L, plr->hyudorotimer);
else if (fastcmp(field,"stealingtimer"))
lua_pushinteger(L, plr->stealingtimer);
else if (fastcmp(field,"sneakertimer"))
lua_pushinteger(L, plr->sneakertimer);
else if (fastcmp(field,"numsneakers"))
lua_pushinteger(L, plr->numsneakers);
else if (fastcmp(field,"floorboost"))
lua_pushinteger(L, plr->floorboost);
else if (fastcmp(field,"growshrinktimer"))
lua_pushinteger(L, plr->growshrinktimer);
else if (fastcmp(field,"rocketsneakertimer"))
lua_pushinteger(L, plr->rocketsneakertimer);
else if (fastcmp(field,"invincibilitytimer"))
lua_pushinteger(L, plr->invincibilitytimer);
else if (fastcmp(field,"eggmanexplode"))
lua_pushinteger(L, plr->eggmanexplode);
else if (fastcmp(field,"eggmanblame"))
lua_pushinteger(L, plr->eggmanblame);
else if (fastcmp(field,"bananadrag"))
lua_pushinteger(L, plr->bananadrag);
else if (fastcmp(field,"lastjawztarget"))
lua_pushinteger(L, plr->lastjawztarget);
else if (fastcmp(field,"jawztargetdelay"))
lua_pushinteger(L, plr->jawztargetdelay);
else if (fastcmp(field,"glanceDir"))
lua_pushinteger(L, plr->glanceDir);
else if (fastcmp(field,"trickpanel"))
lua_pushinteger(L, plr->trickpanel);
else if (fastcmp(field,"trickdelay"))
lua_pushinteger(L, plr->trickdelay);
else if (fastcmp(field,"trickmomx"))
lua_pushfixed(L, plr->trickmomx);
else if (fastcmp(field,"trickmomy"))
lua_pushfixed(L, plr->trickmomy);
else if (fastcmp(field,"trickmomz"))
lua_pushfixed(L, plr->trickmomz);
else if (fastcmp(field,"roundscore"))
plr->roundscore = luaL_checkinteger(L, 3);
else if (fastcmp(field,"emeralds"))
lua_pushinteger(L, plr->emeralds);
else if (fastcmp(field,"bumpers"))
lua_pushinteger(L, plr->bumpers);
else if (fastcmp(field,"karmadelay"))
lua_pushinteger(L, plr->karmadelay);
else if (fastcmp(field,"spheres"))
lua_pushinteger(L, plr->spheres);
else if (fastcmp(field,"pflags"))
lua_pushinteger(L, plr->pflags);
else if (fastcmp(field,"panim"))
@ -280,36 +408,16 @@ static int player_get(lua_State *L)
LUA_PushUserdata(L, plr->followmobj, META_MOBJ);
else if (fastcmp(field,"lives"))
lua_pushinteger(L, plr->lives);
else if (fastcmp(field,"lostlife"))
lua_pushboolean(L, plr->lostlife);
else if (fastcmp(field,"continues"))
lua_pushinteger(L, plr->continues);
else if (fastcmp(field,"xtralife"))
lua_pushinteger(L, plr->xtralife);
else if (fastcmp(field,"gotcontinue"))
lua_pushinteger(L, plr->gotcontinue);
else if (fastcmp(field,"speed"))
lua_pushfixed(L, plr->speed);
else if (fastcmp(field,"secondjump"))
lua_pushinteger(L, plr->secondjump);
else if (fastcmp(field,"fly1"))
lua_pushinteger(L, plr->fly1);
else if (fastcmp(field,"scoreadd"))
lua_pushinteger(L, plr->scoreadd);
else if (fastcmp(field,"glidetime"))
lua_pushinteger(L, plr->glidetime);
else if (fastcmp(field,"climbing"))
lua_pushinteger(L, plr->climbing);
else if (fastcmp(field,"lastspeed"))
lua_pushfixed(L, plr->lastspeed);
else if (fastcmp(field,"deadtimer"))
lua_pushinteger(L, plr->deadtimer);
else if (fastcmp(field,"exiting"))
lua_pushinteger(L, plr->exiting);
else if (fastcmp(field,"homing"))
lua_pushinteger(L, plr->homing);
else if (fastcmp(field,"dashmode"))
lua_pushinteger(L, plr->dashmode);
else if (fastcmp(field,"skidtime"))
lua_pushinteger(L, plr->skidtime);
else if (fastcmp(field,"cmomx"))
lua_pushfixed(L, plr->cmomx);
else if (fastcmp(field,"cmomy"))
@ -318,8 +426,6 @@ static int player_get(lua_State *L)
lua_pushfixed(L, plr->rmomx);
else if (fastcmp(field,"rmomy"))
lua_pushfixed(L, plr->rmomy);
else if (fastcmp(field,"numboxes"))
lua_pushinteger(L, plr->numboxes);
else if (fastcmp(field,"totalring"))
lua_pushinteger(L, plr->totalring);
else if (fastcmp(field,"realtime"))
@ -328,98 +434,14 @@ static int player_get(lua_State *L)
lua_pushinteger(L, plr->laps);
else if (fastcmp(field,"ctfteam"))
lua_pushinteger(L, plr->ctfteam);
else if (fastcmp(field,"gotflag"))
lua_pushinteger(L, plr->gotflag);
else if (fastcmp(field,"weapondelay"))
lua_pushinteger(L, plr->weapondelay);
else if (fastcmp(field,"tossdelay"))
lua_pushinteger(L, plr->tossdelay);
else if (fastcmp(field,"checkskip"))
lua_pushinteger(L, plr->checkskip);
else if (fastcmp(field,"starpostnum"))
lua_pushinteger(L, plr->starpostnum);
else if (fastcmp(field,"angle_pos"))
lua_pushangle(L, plr->angle_pos);
else if (fastcmp(field,"old_angle_pos"))
lua_pushangle(L, plr->old_angle_pos);
else if (fastcmp(field,"axis1"))
LUA_PushUserdata(L, plr->axis1, META_MOBJ);
else if (fastcmp(field,"axis2"))
LUA_PushUserdata(L, plr->axis2, META_MOBJ);
else if (fastcmp(field,"bumpertime"))
lua_pushinteger(L, plr->bumpertime);
else if (fastcmp(field,"flyangle"))
lua_pushinteger(L, plr->flyangle);
else if (fastcmp(field,"drilltimer"))
lua_pushinteger(L, plr->drilltimer);
else if (fastcmp(field,"linkcount"))
lua_pushinteger(L, plr->linkcount);
else if (fastcmp(field,"linktimer"))
lua_pushinteger(L, plr->linktimer);
else if (fastcmp(field,"anotherflyangle"))
lua_pushinteger(L, plr->anotherflyangle);
else if (fastcmp(field,"nightstime"))
lua_pushinteger(L, plr->nightstime);
else if (fastcmp(field,"drillmeter"))
lua_pushinteger(L, plr->drillmeter);
else if (fastcmp(field,"drilldelay"))
lua_pushinteger(L, plr->drilldelay);
else if (fastcmp(field,"bonustime"))
lua_pushboolean(L, plr->bonustime);
else if (fastcmp(field,"capsule"))
LUA_PushUserdata(L, plr->capsule, META_MOBJ);
else if (fastcmp(field,"drone"))
LUA_PushUserdata(L, plr->drone, META_MOBJ);
else if (fastcmp(field,"oldscale"))
lua_pushfixed(L, plr->oldscale);
else if (fastcmp(field,"mare"))
lua_pushinteger(L, plr->mare);
else if (fastcmp(field,"marelap"))
lua_pushinteger(L, plr->marelap);
else if (fastcmp(field,"marebonuslap"))
lua_pushinteger(L, plr->marebonuslap);
else if (fastcmp(field,"marebegunat"))
lua_pushinteger(L, plr->marebegunat);
else if (fastcmp(field,"startedtime"))
lua_pushinteger(L, plr->startedtime);
else if (fastcmp(field,"finishedtime"))
lua_pushinteger(L, plr->finishedtime);
else if (fastcmp(field,"lapbegunat"))
lua_pushinteger(L, plr->lapbegunat);
else if (fastcmp(field,"lapstartedtime"))
lua_pushinteger(L, plr->lapstartedtime);
else if (fastcmp(field,"finishedspheres"))
lua_pushinteger(L, plr->finishedspheres);
else if (fastcmp(field,"finishedrings"))
lua_pushinteger(L, plr->finishedrings);
else if (fastcmp(field,"marescore"))
lua_pushinteger(L, plr->marescore);
else if (fastcmp(field,"lastmarescore"))
lua_pushinteger(L, plr->lastmarescore);
else if (fastcmp(field,"totalmarescore"))
lua_pushinteger(L, plr->totalmarescore);
else if (fastcmp(field,"lastmare"))
lua_pushinteger(L, plr->lastmare);
else if (fastcmp(field,"lastmarelap"))
lua_pushinteger(L, plr->lastmarelap);
else if (fastcmp(field,"lastmarebonuslap"))
lua_pushinteger(L, plr->lastmarebonuslap);
else if (fastcmp(field,"totalmarelap"))
lua_pushinteger(L, plr->totalmarelap);
else if (fastcmp(field,"totalmarebonuslap"))
lua_pushinteger(L, plr->totalmarebonuslap);
else if (fastcmp(field,"maxlink"))
lua_pushinteger(L, plr->maxlink);
else if (fastcmp(field,"texttimer"))
lua_pushinteger(L, plr->texttimer);
else if (fastcmp(field,"textvar"))
lua_pushinteger(L, plr->textvar);
else if (fastcmp(field,"lastsidehit"))
lua_pushinteger(L, plr->lastsidehit);
else if (fastcmp(field,"lastlinehit"))
lua_pushinteger(L, plr->lastlinehit);
else if (fastcmp(field,"losstime"))
lua_pushinteger(L, plr->losstime);
else if (fastcmp(field,"timeshit"))
lua_pushinteger(L, plr->timeshit);
else if (fastcmp(field,"onconveyor"))
lua_pushinteger(L, plr->onconveyor);
else if (fastcmp(field,"awayviewmobj"))
@ -509,23 +531,17 @@ static int player_set(lua_State *L)
}
else if (fastcmp(field,"drawangle"))
plr->drawangle = luaL_checkangle(L, 3);
else if (fastcmp(field,"rings"))
plr->rings = (INT32)luaL_checkinteger(L, 3);
else if (fastcmp(field,"spheres"))
plr->spheres = (INT32)luaL_checkinteger(L, 3);
else if (fastcmp(field,"powers"))
return NOSET;
else if (fastcmp(field,"pflags"))
plr->pflags = luaL_checkinteger(L, 3);
else if (fastcmp(field,"panim"))
plr->panim = luaL_checkinteger(L, 3);
else if (fastcmp(field,"flashcount"))
plr->flashcount = (UINT16)luaL_checkinteger(L, 3);
plr->flashcount = luaL_checkinteger(L, 3);
else if (fastcmp(field,"flashpal"))
plr->flashpal = (UINT16)luaL_checkinteger(L, 3);
plr->flashpal = luaL_checkinteger(L, 3);
else if (fastcmp(field,"skincolor"))
{
UINT16 newcolor = (UINT16)luaL_checkinteger(L,3);
UINT16 newcolor = luaL_checkinteger(L,3);
if (newcolor >= numskincolors)
return luaL_error(L, "player.skincolor %d out of range (0 - %d).", newcolor, numskincolors-1);
plr->skincolor = newcolor;
@ -535,40 +551,172 @@ static int player_set(lua_State *L)
else if (fastcmp(field,"availabilities"))
return NOSET;
else if (fastcmp(field,"score"))
plr->score = (UINT32)luaL_checkinteger(L, 3);
plr->score = luaL_checkinteger(L, 3);
// SRB2kart
else if (fastcmp(field,"kartstuff"))
else if (fastcmp(field,"nocontrol"))
plr->nocontrol = luaL_checkinteger(L, 3);
else if (fastcmp(field,"carry"))
plr->carry = luaL_checkinteger(L, 3);
else if (fastcmp(field,"dye"))
plr->dye = luaL_checkinteger(L, 3);
else if (fastcmp(field,"position"))
plr->position = luaL_checkinteger(L, 3);
else if (fastcmp(field,"oldposition"))
plr->oldposition = luaL_checkinteger(L, 3);
else if (fastcmp(field,"positiondelay"))
plr->positiondelay = luaL_checkinteger(L, 3);
else if (fastcmp(field,"distancetofinish"))
return NOSET;
else if (fastcmp(field,"airtime"))
plr->airtime = (tic_t)luaL_checkinteger(L, 3);
else if (fastcmp(field,"driftInput"))
plr->driftInput = luaL_checkboolean(L, 3);
else if (fastcmp(field,"airFailsafe"))
plr->airFailsafe = luaL_checkboolean(L, 3);
plr->airtime = luaL_checkinteger(L, 3);
else if (fastcmp(field,"flashing"))
plr->flashing = luaL_checkinteger(L, 3);
else if (fastcmp(field,"spinouttimer"))
plr->spinouttimer = luaL_checkinteger(L, 3);
else if (fastcmp(field,"instashield"))
plr->instashield = luaL_checkinteger(L, 3);
else if (fastcmp(field,"wipeoutslow"))
plr->wipeoutslow = luaL_checkinteger(L, 3);
else if (fastcmp(field,"justbumped"))
plr->justbumped = luaL_checkinteger(L, 3);
else if (fastcmp(field,"tumbleBounces"))
plr->tumbleBounces = (UINT8)luaL_checkinteger(L, 3);
plr->tumbleBounces = luaL_checkinteger(L, 3);
else if (fastcmp(field,"tumbleHeight"))
plr->tumbleHeight = (UINT16)luaL_checkinteger(L, 3);
else if (fastcmp(field,"tumbleLastBounce"))
plr->tumbleLastBounce = luaL_checkboolean(L, 3);
else if (fastcmp(field,"tumbleSound"))
plr->tumbleSound = luaL_checkboolean(L, 3);
plr->tumbleHeight = luaL_checkinteger(L, 3);
else if (fastcmp(field,"drift"))
plr->drift = luaL_checkinteger(L, 3);
else if (fastcmp(field,"driftcharge"))
plr->driftcharge = luaL_checkinteger(L, 3);
else if (fastcmp(field,"driftboost"))
plr->driftboost = luaL_checkinteger(L, 3);
else if (fastcmp(field,"aizdriftstraft"))
plr->aizdriftstrat = luaL_checkinteger(L, 3);
else if (fastcmp(field,"aizdrifttilt"))
plr->aizdrifttilt = luaL_checkinteger(L, 3);
else if (fastcmp(field,"aizdriftturn"))
plr->aizdriftturn = luaL_checkinteger(L, 3);
else if (fastcmp(field,"offroad"))
plr->offroad = luaL_checkinteger(L, 3);
else if (fastcmp(field,"waterskip"))
plr->waterskip = luaL_checkinteger(L, 3);
else if (fastcmp(field,"tiregrease"))
plr->tiregrease = luaL_checkinteger(L, 3);
else if (fastcmp(field,"springstars"))
plr->springstars = luaL_checkinteger(L, 3);
else if (fastcmp(field,"springcolor"))
plr->springcolor = luaL_checkinteger(L, 3);
else if (fastcmp(field,"dashpadcooldown"))
plr->dashpadcooldown = luaL_checkinteger(L, 3);
else if (fastcmp(field,"spindash"))
plr->spindash = luaL_checkinteger(L, 3);
else if (fastcmp(field,"spindashspeed"))
plr->spindashspeed = luaL_checkinteger(L, 3);
else if (fastcmp(field,"spindashboost"))
plr->spindashboost = luaL_checkinteger(L, 3);
else if (fastcmp(field,"numboosts"))
plr->numboosts = luaL_checkinteger(L, 3);
else if (fastcmp(field,"boostpower"))
plr->boostpower = luaL_checkinteger(L, 3);
else if (fastcmp(field,"speedboost"))
plr->speedboost = luaL_checkinteger(L, 3);
else if (fastcmp(field,"accelboost"))
plr->accelboost = luaL_checkinteger(L, 3);
else if (fastcmp(field,"handleboost"))
plr->handleboost = luaL_checkinteger(L, 3);
else if (fastcmp(field,"boostangle"))
plr->boostangle = luaL_checkinteger(L, 3);
else if (fastcmp(field,"draftpower"))
plr->draftpower = luaL_checkinteger(L, 3);
else if (fastcmp(field,"draftleeway"))
plr->draftleeway = luaL_checkinteger(L, 3);
else if (fastcmp(field,"lastdraft"))
plr->lastdraft = luaL_checkinteger(L, 3);
else if (fastcmp(field,"itemroulette"))
plr->itemroulette = luaL_checkinteger(L, 3);
else if (fastcmp(field,"roulettetype"))
plr->roulettetype = luaL_checkinteger(L, 3);
else if (fastcmp(field,"itemtype"))
plr->itemtype = luaL_checkinteger(L, 3);
else if (fastcmp(field,"itemamount"))
plr->itemamount = luaL_checkinteger(L, 3);
else if (fastcmp(field,"throwdir"))
plr->throwdir = luaL_checkinteger(L, 3);
else if (fastcmp(field,"sadtimer"))
plr->sadtimer = luaL_checkinteger(L, 3);
else if (fastcmp(field,"rings"))
plr->rings = luaL_checkinteger(L, 3);
else if (fastcmp(field,"pickuprings"))
plr->pickuprings = luaL_checkinteger(L, 3);
else if (fastcmp(field,"ringdelay"))
plr->ringdelay = luaL_checkinteger(L, 3);
else if (fastcmp(field,"ringboost"))
plr->ringboost = luaL_checkinteger(L, 3);
else if (fastcmp(field,"sparkleanim"))
plr->sparkleanim = luaL_checkinteger(L, 3);
else if (fastcmp(field,"superring"))
plr->superring = luaL_checkinteger(L, 3);
else if (fastcmp(field,"curshield"))
plr->curshield = luaL_checkinteger(L, 3);
else if (fastcmp(field,"bubblecool"))
plr->bubblecool = luaL_checkinteger(L, 3);
else if (fastcmp(field,"bubbleblowup"))
plr->bubbleblowup = luaL_checkinteger(L, 3);
else if (fastcmp(field,"flamedash"))
plr->flamedash = luaL_checkinteger(L, 3);
else if (fastcmp(field,"flamemeter"))
plr->flamemeter = luaL_checkinteger(L, 3);
else if (fastcmp(field,"flamelength"))
plr->flamelength = luaL_checkinteger(L, 3);
else if (fastcmp(field,"hyudorotimer"))
plr->hyudorotimer = luaL_checkinteger(L, 3);
else if (fastcmp(field,"stealingtimer"))
plr->stealingtimer = luaL_checkinteger(L, 3);
else if (fastcmp(field,"sneakertimer"))
plr->sneakertimer = luaL_checkinteger(L, 3);
else if (fastcmp(field,"numsneakers"))
plr->numsneakers = luaL_checkinteger(L, 3);
else if (fastcmp(field,"floorboost"))
plr->floorboost = luaL_checkinteger(L, 3);
else if (fastcmp(field,"growshrinktimer"))
plr->growshrinktimer = luaL_checkinteger(L, 3);
else if (fastcmp(field,"rocketsneakertimer"))
plr->rocketsneakertimer = luaL_checkinteger(L, 3);
else if (fastcmp(field,"invincibilitytimer"))
plr->invincibilitytimer = luaL_checkinteger(L, 3);
else if (fastcmp(field,"eggmanexplode"))
plr->eggmanexplode = luaL_checkinteger(L, 3);
else if (fastcmp(field,"eggmanblame"))
plr->eggmanblame = luaL_checkinteger(L, 3);
else if (fastcmp(field,"bananadrag"))
plr->bananadrag = luaL_checkinteger(L, 3);
else if (fastcmp(field,"lastjawztarget"))
plr->lastjawztarget = luaL_checkinteger(L, 3);
else if (fastcmp(field,"jawztargetdelay"))
plr->jawztargetdelay = luaL_checkinteger(L, 3);
else if (fastcmp(field,"glanceDir"))
plr->glanceDir = (SINT8)luaL_checkinteger(L, 3);
plr->glanceDir = luaL_checkinteger(L, 3);
else if (fastcmp(field,"trickpanel"))
plr->trickpanel = luaL_checkinteger(L, 3);
else if (fastcmp(field,"trickdelay"))
plr->trickdelay = (tic_t)luaL_checkinteger(L, 3);
else if (fastcmp(field,"trickmomx"))
plr->trickmomx = (fixed_t)luaL_checkfixed(L, 3);
plr->trickmomx = luaL_checkfixed(L, 3);
else if (fastcmp(field,"trickmomy"))
plr->trickmomy = (fixed_t)luaL_checkfixed(L, 3);
plr->trickmomy = luaL_checkfixed(L, 3);
else if (fastcmp(field,"trickmomz"))
plr->trickmomz = (fixed_t)luaL_checkfixed(L, 3);
plr->trickmomz = luaL_checkfixed(L, 3);
else if (fastcmp(field,"roundscore"))
lua_pushinteger(L, plr->roundscore);
else if (fastcmp(field,"emeralds"))
plr->emeralds = luaL_checkinteger(L, 3);
else if (fastcmp(field,"bumpers"))
plr->bumpers = luaL_checkinteger(L, 3);
else if (fastcmp(field,"karmadelay"))
plr->karmadelay = luaL_checkinteger(L, 3);
else if (fastcmp(field,"spheres"))
plr->spheres = luaL_checkinteger(L, 3);
else if (fastcmp(field,"kartspeed"))
plr->kartspeed = (UINT8)luaL_checkinteger(L, 3);
plr->kartspeed = luaL_checkinteger(L, 3);
else if (fastcmp(field,"kartweight"))
plr->kartweight = (UINT8)luaL_checkinteger(L, 3);
plr->kartweight = luaL_checkinteger(L, 3);
else if (fastcmp(field,"followerskin"))
plr->followerskin = luaL_checkinteger(L, 3);
else if (fastcmp(field,"followercolor"))
@ -591,36 +739,16 @@ static int player_set(lua_State *L)
}
else if (fastcmp(field,"lives"))
plr->lives = (SINT8)luaL_checkinteger(L, 3);
else if (fastcmp(field,"lostlife"))
plr->lostlife = luaL_checkboolean(L, 3);
else if (fastcmp(field,"continues"))
plr->continues = (SINT8)luaL_checkinteger(L, 3);
else if (fastcmp(field,"xtralife"))
plr->xtralife = (SINT8)luaL_checkinteger(L, 3);
else if (fastcmp(field,"gotcontinue"))
plr->gotcontinue = (UINT8)luaL_checkinteger(L, 3);
else if (fastcmp(field,"speed"))
plr->speed = luaL_checkfixed(L, 3);
else if (fastcmp(field,"secondjump"))
plr->secondjump = (UINT8)luaL_checkinteger(L, 3);
else if (fastcmp(field,"fly1"))
plr->fly1 = (UINT8)luaL_checkinteger(L, 3);
else if (fastcmp(field,"scoreadd"))
plr->scoreadd = (UINT8)luaL_checkinteger(L, 3);
else if (fastcmp(field,"glidetime"))
plr->glidetime = (tic_t)luaL_checkinteger(L, 3);
else if (fastcmp(field,"climbing"))
plr->climbing = (INT32)luaL_checkinteger(L, 3);
else if (fastcmp(field,"lastspeed"))
plr->lastspeed = luaL_checkfixed(L, 3);
else if (fastcmp(field,"deadtimer"))
plr->deadtimer = (INT32)luaL_checkinteger(L, 3);
else if (fastcmp(field,"exiting"))
plr->exiting = (tic_t)luaL_checkinteger(L, 3);
else if (fastcmp(field,"homing"))
plr->homing = (UINT8)luaL_checkinteger(L, 3);
else if (fastcmp(field,"dashmode"))
plr->dashmode = (tic_t)luaL_checkinteger(L, 3);
else if (fastcmp(field,"skidtime"))
plr->skidtime = (tic_t)luaL_checkinteger(L, 3);
else if (fastcmp(field,"cmomx"))
plr->cmomx = luaL_checkfixed(L, 3);
else if (fastcmp(field,"cmomy"))
@ -629,8 +757,6 @@ static int player_set(lua_State *L)
plr->rmomx = luaL_checkfixed(L, 3);
else if (fastcmp(field,"rmomy"))
plr->rmomy = luaL_checkfixed(L, 3);
else if (fastcmp(field,"numboxes"))
plr->numboxes = (INT16)luaL_checkinteger(L, 3);
else if (fastcmp(field,"totalring"))
plr->totalring = (INT16)luaL_checkinteger(L, 3);
else if (fastcmp(field,"realtime"))
@ -639,118 +765,14 @@ static int player_set(lua_State *L)
plr->laps = (UINT8)luaL_checkinteger(L, 3);
else if (fastcmp(field,"ctfteam"))
plr->ctfteam = (INT32)luaL_checkinteger(L, 3);
else if (fastcmp(field,"gotflag"))
plr->gotflag = (UINT16)luaL_checkinteger(L, 3);
else if (fastcmp(field,"weapondelay"))
plr->weapondelay = (INT32)luaL_checkinteger(L, 3);
else if (fastcmp(field,"tossdelay"))
plr->tossdelay = (INT32)luaL_checkinteger(L, 3);
else if (fastcmp(field,"checkskip"))
plr->checkskip = (INT32)luaL_checkinteger(L, 3);
else if (fastcmp(field,"starpostnum"))
plr->starpostnum = (INT32)luaL_checkinteger(L, 3);
else if (fastcmp(field,"angle_pos"))
plr->angle_pos = luaL_checkangle(L, 3);
else if (fastcmp(field,"old_angle_pos"))
plr->old_angle_pos = luaL_checkangle(L, 3);
else if (fastcmp(field,"axis1"))
{
mobj_t *mo = NULL;
if (!lua_isnil(L, 3))
mo = *((mobj_t **)luaL_checkudata(L, 3, META_MOBJ));
P_SetTarget(&plr->axis1, mo);
}
else if (fastcmp(field,"axis2"))
{
mobj_t *mo = NULL;
if (!lua_isnil(L, 3))
mo = *((mobj_t **)luaL_checkudata(L, 3, META_MOBJ));
P_SetTarget(&plr->axis2, mo);
}
else if (fastcmp(field,"bumpertime"))
plr->bumpertime = (tic_t)luaL_checkinteger(L, 3);
else if (fastcmp(field,"flyangle"))
plr->flyangle = (INT32)luaL_checkinteger(L, 3);
else if (fastcmp(field,"drilltimer"))
plr->drilltimer = (tic_t)luaL_checkinteger(L, 3);
else if (fastcmp(field,"linkcount"))
plr->linkcount = (INT32)luaL_checkinteger(L, 3);
else if (fastcmp(field,"linktimer"))
plr->linktimer = (tic_t)luaL_checkinteger(L, 3);
else if (fastcmp(field,"anotherflyangle"))
plr->anotherflyangle = (INT32)luaL_checkinteger(L, 3);
else if (fastcmp(field,"nightstime"))
plr->nightstime = (tic_t)luaL_checkinteger(L, 3);
else if (fastcmp(field,"drillmeter"))
plr->drillmeter = (INT32)luaL_checkinteger(L, 3);
else if (fastcmp(field,"drilldelay"))
plr->drilldelay = (UINT8)luaL_checkinteger(L, 3);
else if (fastcmp(field,"bonustime"))
plr->bonustime = luaL_checkboolean(L, 3);
else if (fastcmp(field,"capsule"))
{
mobj_t *mo = NULL;
if (!lua_isnil(L, 3))
mo = *((mobj_t **)luaL_checkudata(L, 3, META_MOBJ));
P_SetTarget(&plr->capsule, mo);
}
else if (fastcmp(field,"drone"))
{
mobj_t *mo = NULL;
if (!lua_isnil(L, 3))
mo = *((mobj_t **)luaL_checkudata(L, 3, META_MOBJ));
P_SetTarget(&plr->drone, mo);
}
else if (fastcmp(field,"oldscale"))
plr->oldscale = luaL_checkfixed(L, 3);
else if (fastcmp(field,"mare"))
plr->mare = (UINT8)luaL_checkinteger(L, 3);
else if (fastcmp(field,"marelap"))
plr->marelap = (UINT8)luaL_checkinteger(L, 3);
else if (fastcmp(field,"marebonuslap"))
plr->marebonuslap = (UINT8)luaL_checkinteger(L, 3);
else if (fastcmp(field,"marebegunat"))
plr->marebegunat = (tic_t)luaL_checkinteger(L, 3);
else if (fastcmp(field,"startedtime"))
plr->startedtime = (tic_t)luaL_checkinteger(L, 3);
else if (fastcmp(field,"finishedtime"))
plr->finishedtime = (tic_t)luaL_checkinteger(L, 3);
else if (fastcmp(field,"lapbegunat"))
plr->lapbegunat = (tic_t)luaL_checkinteger(L, 3);
else if (fastcmp(field,"lapstartedtime"))
plr->lapstartedtime = (tic_t)luaL_checkinteger(L, 3);
else if (fastcmp(field,"finishedspheres"))
plr->finishedspheres = (INT16)luaL_checkinteger(L, 3);
else if (fastcmp(field,"finishedrings"))
plr->finishedrings = (INT16)luaL_checkinteger(L, 3);
else if (fastcmp(field,"marescore"))
plr->marescore = (UINT32)luaL_checkinteger(L, 3);
else if (fastcmp(field,"lastmarescore"))
plr->lastmarescore = (UINT32)luaL_checkinteger(L, 3);
else if (fastcmp(field,"totalmarescore"))
plr->totalmarescore = (UINT32)luaL_checkinteger(L, 3);
else if (fastcmp(field,"lastmare"))
plr->lastmare = (UINT8)luaL_checkinteger(L, 3);
else if (fastcmp(field,"lastmarelap"))
plr->lastmarelap = (UINT8)luaL_checkinteger(L, 3);
else if (fastcmp(field,"lastmarebonuslap"))
plr->lastmarebonuslap = (UINT8)luaL_checkinteger(L, 3);
else if (fastcmp(field,"totalmarelap"))
plr->totalmarelap = (UINT8)luaL_checkinteger(L, 3);
else if (fastcmp(field,"totalmarebonuslap"))
plr->totalmarebonuslap = (UINT8)luaL_checkinteger(L, 3);
else if (fastcmp(field,"maxlink"))
plr->maxlink = (INT32)luaL_checkinteger(L, 3);
else if (fastcmp(field,"texttimer"))
plr->texttimer = (UINT8)luaL_checkinteger(L, 3);
else if (fastcmp(field,"textvar"))
plr->textvar = (UINT8)luaL_checkinteger(L, 3);
else if (fastcmp(field,"lastsidehit"))
plr->lastsidehit = (INT16)luaL_checkinteger(L, 3);
else if (fastcmp(field,"lastlinehit"))
plr->lastlinehit = (INT16)luaL_checkinteger(L, 3);
else if (fastcmp(field,"losstime"))
plr->losstime = (tic_t)luaL_checkinteger(L, 3);
else if (fastcmp(field,"timeshit"))
plr->timeshit = (UINT8)luaL_checkinteger(L, 3);
else if (fastcmp(field,"onconveyor"))
plr->onconveyor = (INT32)luaL_checkinteger(L, 3);
else if (fastcmp(field,"awayviewmobj"))
@ -813,74 +835,6 @@ static int player_num(lua_State *L)
return 1;
}
// powers, p -> powers[p]
static int power_get(lua_State *L)
{
UINT16 *powers = *((UINT16 **)luaL_checkudata(L, 1, META_POWERS));
powertype_t p = luaL_checkinteger(L, 2);
if (p >= NUMPOWERS)
return luaL_error(L, LUA_QL("powertype_t") " cannot be %d", (INT16)p);
lua_pushinteger(L, powers[p]);
return 1;
}
// powers, p, value -> powers[p] = value
static int power_set(lua_State *L)
{
UINT16 *powers = *((UINT16 **)luaL_checkudata(L, 1, META_POWERS));
powertype_t p = luaL_checkinteger(L, 2);
UINT16 i = (UINT16)luaL_checkinteger(L, 3);
if (p >= NUMPOWERS)
return luaL_error(L, LUA_QL("powertype_t") " cannot be %d", (INT16)p);
if (hud_running)
return luaL_error(L, "Do not alter player_t in HUD rendering code!");
if (hook_cmd_running)
return luaL_error(L, "Do not alter player_t in CMD building code!");
powers[p] = i;
return 0;
}
// #powers -> NUMPOWERS
static int power_len(lua_State *L)
{
lua_pushinteger(L, NUMPOWERS);
return 1;
}
// kartstuff, ks -> kartstuff[ks]
static int kartstuff_get(lua_State *L)
{
INT32 *kartstuff = *((INT32 **)luaL_checkudata(L, 1, META_KARTSTUFF));
kartstufftype_t ks = luaL_checkinteger(L, 2);
if (ks >= NUMKARTSTUFF)
return luaL_error(L, LUA_QL("kartstufftype_t") " cannot be %u", ks);
lua_pushinteger(L, kartstuff[ks]);
return 1;
}
// kartstuff, ks, value -> kartstuff[ks] = value
static int kartstuff_set(lua_State *L)
{
INT32 *kartstuff = *((INT32 **)luaL_checkudata(L, 1, META_KARTSTUFF));
kartstufftype_t ks = luaL_checkinteger(L, 2);
INT32 i = (INT32)luaL_checkinteger(L, 3);
if (ks >= NUMKARTSTUFF)
return luaL_error(L, LUA_QL("kartstufftype_t") " cannot be %u", ks);
if (hud_running)
return luaL_error(L, "Do not alter player_t in HUD rendering code!");
if (hook_cmd_running)
return luaL_error(L, "Do not alter player_t in BuildCMD code!");
kartstuff[ks] = i;
return 0;
}
// #karthud -> NUMKARTSTUFF
static int kartstuff_len(lua_State *L)
{
lua_pushinteger(L, NUMKARTSTUFF);
return 1;
}
// karthud, ks -> karthud[ks]
static int karthud_get(lua_State *L)
{
@ -892,7 +846,7 @@ static int karthud_get(lua_State *L)
return 1;
}
// karthud, ks, value -> kartstuff[ks] = value
// karthud, ks, value -> karthud[ks] = value
static int karthud_set(lua_State *L)
{
INT32 *karthud = *((INT32 **)luaL_checkudata(L, 1, META_KARTHUD));
@ -1063,28 +1017,6 @@ int LUA_PlayerLib(lua_State *L)
lua_setfield(L, -2, "__len");
lua_pop(L,1);
luaL_newmetatable(L, META_POWERS);
lua_pushcfunction(L, power_get);
lua_setfield(L, -2, "__index");
lua_pushcfunction(L, power_set);
lua_setfield(L, -2, "__newindex");
lua_pushcfunction(L, power_len);
lua_setfield(L, -2, "__len");
lua_pop(L,1);
luaL_newmetatable(L, META_KARTSTUFF);
lua_pushcfunction(L, kartstuff_get);
lua_setfield(L, -2, "__index");
lua_pushcfunction(L, kartstuff_set);
lua_setfield(L, -2, "__newindex");
lua_pushcfunction(L, kartstuff_len);
lua_setfield(L, -2, "__len");
lua_pop(L,1);
luaL_newmetatable(L, META_KARTHUD);
lua_pushcfunction(L, karthud_get);
lua_setfield(L, -2, "__index");

View file

@ -945,8 +945,7 @@ void LUA_InvalidatePlayer(player_t *player)
if (!gL)
return;
LUA_InvalidateUserdata(player);
LUA_InvalidateUserdata(player->powers);
LUA_InvalidateUserdata(player->kartstuff);
LUA_InvalidateUserdata(player->karthud);
LUA_InvalidateUserdata(&player->cmd);
}

View file

@ -317,20 +317,6 @@ void Command_CheatGod_f(void)
G_SetGameModified(multiplayer, true);
}
void Command_CheatNoTarget_f(void)
{
player_t *plyr;
REQUIRE_INLEVEL;
REQUIRE_SINGLEPLAYER;
plyr = &players[consoleplayer];
plyr->pflags ^= PF_INVIS;
CONS_Printf(M_GetText("SEP Field %s\n"), plyr->pflags & PF_INVIS ? M_GetText("On") : M_GetText("Off"));
G_SetGameModified(multiplayer, true);
}
void Command_Scale_f(void)
{
const double scaled = atof(COM_Argv(1));
@ -1147,7 +1133,7 @@ void OP_ObjectplaceMovement(player_t *player)
mt = OP_CreateNewMapThing(player, (UINT16)spawnthing, ceiling);
if (mt->type >= 600 && mt->type <= 609) // Placement patterns
P_SpawnItemPattern(mt, false);
P_SpawnItemPattern(mt);
else if (mt->type == 1705 || mt->type == 1713) // NiGHTS Hoops
P_SpawnHoop(mt);
else
@ -1291,6 +1277,6 @@ void Command_ObjectPlace_f(void)
players[0].mo->color = op_oldcolor;
// This is necessary for recovery of dying players.
players[0].powers[pw_flashing] = K_GetKartFlashing(&players[0]);
players[0].flashing = K_GetKartFlashing(&players[0]);
}
}

View file

@ -45,7 +45,6 @@ void OP_ObjectplaceMovement(player_t *player);
//
void Command_CheatNoClip_f(void);
void Command_CheatGod_f(void);
void Command_CheatNoTarget_f(void);
void Command_Savecheckpoint_f(void);
void Command_Setrings_f(void);
void Command_Setlives_f(void);

View file

@ -105,13 +105,8 @@ void A_Scream(mobj_t *actor);
void A_Pain(mobj_t *actor);
void A_Explode(mobj_t *actor);
void A_BossDeath(mobj_t *actor);
void A_CustomPower(mobj_t *actor);
void A_RingBox(mobj_t *actor);
void A_Invincibility(mobj_t *actor);
void A_SuperSneakers(mobj_t *actor);
void A_AwardScore(mobj_t *actor);
void A_GiveShield(mobj_t *actor);
void A_GravityBox(mobj_t *actor);
void A_ScoreRise(mobj_t *actor);
void A_BunnyHop(mobj_t *actor);
void A_BubbleSpawn(mobj_t *actor);
@ -742,9 +737,6 @@ boolean P_LookForPlayers(mobj_t *actor, boolean allaround, boolean tracer, fixed
if ((netgame || multiplayer) && player->spectator)
continue;
if (player->pflags & PF_INVIS)
continue; // ignore notarget
if (!player->mo || P_MobjWasRemoved(player->mo))
continue;
@ -3442,7 +3434,7 @@ void A_BossDeath(mobj_t *mo)
// make sure there is a player alive for victory
for (i = 0; i < MAXPLAYERS; i++)
if (playeringame[i] && ((players[i].mo && players[i].mo->health)
|| ((netgame || multiplayer) && (players[i].lives || players[i].continues))))
|| ((netgame || multiplayer) && players[i].lives)))
break;
if (i == MAXPLAYERS)
@ -3729,48 +3721,6 @@ bossjustdie:
}
}
// Function: A_CustomPower
//
// Description: Provides a custom powerup. Target (must be a player) is awarded the powerup. Reactiontime of the object is used as an index to the powers array.
//
// var1 = Power index #
// var2 = Power duration in tics
//
void A_CustomPower(mobj_t *actor)
{
player_t *player;
INT32 locvar1 = var1;
INT32 locvar2 = var2;
boolean spawnshield = false;
if (LUA_CallAction(A_CUSTOMPOWER, actor))
return;
if (!actor->target || !actor->target->player)
{
CONS_Debug(DBG_GAMELOGIC, "Powerup has no target.\n");
return;
}
if (locvar1 >= NUMPOWERS)
{
CONS_Debug(DBG_GAMELOGIC, "Power #%d out of range!\n", locvar1);
return;
}
player = actor->target->player;
if (locvar1 == pw_shield && player->powers[pw_shield] != locvar2)
spawnshield = true;
player->powers[locvar1] = (UINT16)locvar2;
if (actor->info->seesound)
S_StartSound(player->mo, actor->info->seesound);
if (spawnshield) //workaround for a bug
P_SpawnShieldOrb(player);
}
// Function: A_RingBox
//
// Description: Awards the player 10 rings.
@ -3798,70 +3748,6 @@ void A_RingBox(mobj_t *actor)
S_StartSound(player->mo, actor->info->seesound);
}
// Function: A_Invincibility
//
// Description: Awards the player invincibility.
//
// var1 = unused
// var2 = unused
//
void A_Invincibility(mobj_t *actor)
{
player_t *player;
if (LUA_CallAction(A_INVINCIBILITY, actor))
return;
if (!actor->target || !actor->target->player)
{
CONS_Debug(DBG_GAMELOGIC, "Powerup has no target.\n");
return;
}
player = actor->target->player;
player->powers[pw_invulnerability] = invulntics + 1;
if (P_IsLocalPlayer(player) && !player->powers[pw_super])
{
P_PlayJingle(player, JT_INV);
strlcpy(S_sfx[sfx_None].caption, "Invincibility", 14);
S_StartCaption(sfx_None, -1, player->powers[pw_invulnerability]);
}
}
// Function: A_SuperSneakers
//
// Description: Awards the player super sneakers.
//
// var1 = unused
// var2 = unused
//
void A_SuperSneakers(mobj_t *actor)
{
player_t *player;
if (LUA_CallAction(A_SUPERSNEAKERS, actor))
return;
if (!actor->target || !actor->target->player)
{
CONS_Debug(DBG_GAMELOGIC, "Powerup has no target.\n");
return;
}
player = actor->target->player;
actor->target->player->powers[pw_sneakers] = sneakertics + 1;
if (P_IsLocalPlayer(player) && !player->powers[pw_super])
{
if (S_SpeedMusic(0.0f))
S_SpeedMusic(1.4f);
strlcpy(S_sfx[sfx_None].caption, "Speed shoes", 12);
S_StartCaption(sfx_None, -1, player->powers[pw_sneakers]);
}
}
// Function: A_AwardScore
//
// Description: Adds a set amount of points to the player's score.
@ -3889,60 +3775,6 @@ void A_AwardScore(mobj_t *actor)
S_StartSound(player->mo, actor->info->seesound);
}
// Function: A_GiveShield
//
// Description: Awards the player a specified shield.
//
// var1 = Shield type (make with SH_ constants)
// var2 = unused
//
void A_GiveShield(mobj_t *actor)
{
player_t *player;
UINT16 locvar1 = var1;
if (LUA_CallAction(A_GIVESHIELD, actor))
return;
if (!actor->target || !actor->target->player)
{
CONS_Debug(DBG_GAMELOGIC, "Powerup has no target.\n");
return;
}
player = actor->target->player;
P_SwitchShield(player, locvar1);
S_StartSound(player->mo, actor->info->seesound);
}
// Function: A_GravityBox
//
// Description: Awards the player gravity boots.
//
// var1 = unused
// var2 = unused
//
void A_GravityBox(mobj_t *actor)
{
player_t *player;
if (LUA_CallAction(A_GRAVITYBOX, actor))
return;
if (!actor->target || !actor->target->player)
{
CONS_Debug(DBG_GAMELOGIC, "Powerup has no target.\n");
return;
}
player = actor->target->player;
S_StartSound(player, actor->info->activesound);
player->powers[pw_gravityboots] = (UINT16)(actor->info->reactiontime + 1);
}
// Function: A_ScoreRise
//
// Description: Makes the little score logos rise. Speed value sets speed.
@ -4173,13 +4005,13 @@ void A_AttractChase(mobj_t *actor)
angle_t offset = FixedAngle(18<<FRACBITS);
// Base add is 3 tics for 9,9, adds 1 tic for each point closer to the 1,1 end
actor->target->player->kartstuff[k_ringboost] += K_GetKartRingPower(actor->target->player, true) + 3;
actor->target->player->ringboost += K_GetKartRingPower(actor->target->player, true) + 3;
S_StartSound(actor->target, sfx_s1b5);
sparkle = P_SpawnMobj(actor->target->x, actor->target->y, actor->target->z, MT_RINGSPARKS);
P_SetTarget(&sparkle->target, actor->target);
sparkle->angle = (actor->target->angle + (offset>>1)) + (offset * actor->target->player->kartstuff[k_sparkleanim]);
actor->target->player->kartstuff[k_sparkleanim] = (actor->target->player->kartstuff[k_sparkleanim]+1) % 20;
sparkle->angle = (actor->target->angle + (offset>>1)) + (offset * actor->target->player->sparkleanim);
actor->target->player->sparkleanim = (actor->target->player->sparkleanim+1) % 20;
P_KillMobj(actor, actor->target, actor->target, DMG_NORMAL);
return;
@ -4201,14 +4033,14 @@ void A_AttractChase(mobj_t *actor)
if (actor->extravalue1 >= 16)
{
if (!P_GivePlayerRings(actor->target->player, 1)) // returns 0 if addition failed
actor->target->player->kartstuff[k_ringboost] += K_GetKartRingPower(actor->target->player, true) + 3;
actor->target->player->ringboost += K_GetKartRingPower(actor->target->player, true) + 3;
if (actor->cvmem) // caching
S_StartSound(actor->target, sfx_s1c5);
else
S_StartSound(actor->target, sfx_s227);
actor->target->player->kartstuff[k_pickuprings]--;
actor->target->player->pickuprings--;
P_RemoveMobj(actor);
return;
}
@ -4257,9 +4089,9 @@ void A_AttractChase(mobj_t *actor)
if (actor->tracer && actor->tracer->player && actor->tracer->health
//&& P_CheckSight(actor, actor->tracer)
&& actor->tracer->player->kartstuff[k_itemtype] == KITEM_THUNDERSHIELD
&& actor->tracer->player->itemtype == KITEM_THUNDERSHIELD
&& RINGTOTAL(actor->tracer->player) < 20
&& !actor->tracer->player->kartstuff[k_ringlock])
&& !(actor->tracer->player->pflags & PF_RINGLOCK))
{
fixed_t dist;
angle_t hang, vang;
@ -5852,7 +5684,7 @@ void A_MixUp(mobj_t *actor)
for (i = 0; i < MAXPLAYERS; i++)
if (playeringame[i] && players[i].mo && players[i].mo->health > 0 && players[i].playerstate == PST_LIVE
&& !players[i].exiting && !players[i].powers[pw_super])
&& !players[i].exiting)
{
if ((netgame || multiplayer) && players[i].spectator) // Ignore spectators
continue;
@ -5877,8 +5709,8 @@ void A_MixUp(mobj_t *actor)
players[two].speed = transspeed;
//set flags variables now but DON'T set them.
carry1 = players[one].powers[pw_carry];
carry2 = players[two].powers[pw_carry];
carry1 = players[one].carry;
carry2 = players[two].carry;
x = players[one].mo->x;
y = players[one].mo->y;
@ -5904,8 +5736,8 @@ void A_MixUp(mobj_t *actor)
//carry set after mixup. Stupid P_ResetPlayer() takes away some of the stuff we look for...
//but not all of it! So we need to make sure they aren't set wrong or anything.
players[one].powers[pw_carry] = carry2;
players[two].powers[pw_carry] = carry1;
players[one].carry = carry2;
players[two].carry = carry1;
teleported[one] = true;
teleported[two] = true;
@ -5952,7 +5784,7 @@ void A_MixUp(mobj_t *actor)
players[i].rmomx = players[i].rmomy = 1;
players[i].cmomx = players[i].cmomy = 0;
transcarry[counter] = players[i].powers[pw_carry];
transcarry[counter] = players[i].carry;
transspeed[counter] = players[i].speed;
transtracer[counter] = players[i].mo->tracer;
@ -6003,7 +5835,7 @@ void A_MixUp(mobj_t *actor)
FRACUNIT, anglepos[teleportfrom][1], flags2[teleportfrom]);
//...carry after. same reasoning.
players[i].powers[pw_carry] = transcarry[teleportfrom];
players[i].carry = transcarry[teleportfrom];
teleported[i] = true;
counter++;
@ -6555,7 +6387,7 @@ void A_Boss2PogoTarget(mobj_t *actor)
if (LUA_CallAction(A_BOSS2POGOTARGET, actor))
return;
if (!actor->target || !(actor->target->flags & MF_SHOOTABLE) || (actor->target->player && actor->target->player->powers[pw_flashing])
if (!actor->target || !(actor->target->flags & MF_SHOOTABLE) || (actor->target->player && actor->target->player->flashing)
|| P_AproxDistance(actor->x-actor->target->x, actor->y-actor->target->y) >= FixedMul(512*FRACUNIT, actor->scale))
{
// look for a new target
@ -6568,7 +6400,7 @@ void A_Boss2PogoTarget(mobj_t *actor)
}
// Target hit, retreat!
if ((actor->target->player && actor->target->player->powers[pw_flashing] > TICRATE) || actor->flags2 & MF2_FRET)
if ((actor->target->player && actor->target->player->flashing > TICRATE) || actor->flags2 & MF2_FRET)
{
UINT8 prandom = P_RandomByte();
actor->z++; // unstick from the floor
@ -6759,8 +6591,7 @@ void A_SparkFollow(mobj_t *actor)
if (LUA_CallAction(A_SPARKFOLLOW, actor))
return;
if ((!actor->target || (actor->target->health <= 0))
|| (actor->target->player && !actor->target->player->powers[pw_super]))
if (!actor->target || (actor->target->health <= 0))
{
P_RemoveMobj(actor);
return;
@ -7697,7 +7528,7 @@ void A_FindTarget(mobj_t *actor)
if (mo2->type == (mobjtype_t)locvar1)
{
if (mo2->player && (mo2->player->spectator || mo2->player->pflags & PF_INVIS))
if (mo2->player && mo2->player->spectator)
continue; // Ignore spectators
if ((mo2->player || mo2->flags & MF_ENEMY) && mo2->health <= 0)
continue; // Ignore dead things
@ -7761,7 +7592,7 @@ void A_FindTracer(mobj_t *actor)
if (mo2->type == (mobjtype_t)locvar1)
{
if (mo2->player && (mo2->player->spectator || mo2->player->pflags & PF_INVIS))
if (mo2->player && mo2->player->spectator)
continue; // Ignore spectators
if ((mo2->player || mo2->flags & MF_ENEMY) && mo2->health <= 0)
continue; // Ignore dead things
@ -7903,7 +7734,7 @@ void A_Dye(mobj_t *actor)
// What if it's a player?
if (target->player)
target->player->powers[pw_dye] = color;
target->player->dye = color;
if (!color)
{
@ -9599,7 +9430,7 @@ void A_ForceWin(mobj_t *actor)
for (i = 0; i < MAXPLAYERS; i++)
{
if (playeringame[i] && ((players[i].mo && players[i].mo->health)
|| ((netgame || multiplayer) && (players[i].lives || players[i].continues))))
|| ((netgame || multiplayer) && players[i].lives)))
break;
}
@ -11790,7 +11621,7 @@ void A_Boss5FindWaypoint(mobj_t *actor)
continue;
if (players[i].mo->health <= 0)
continue;
if (players[i].powers[pw_flashing])
if (players[i].flashing)
continue;
if (actor->tracer == players[i].mo) // this was your tracer last time
continue;
@ -11849,7 +11680,7 @@ void A_Boss5FindWaypoint(mobj_t *actor)
continue;
if (players[i].mo->health <= 0)
continue;
if (players[i].powers[pw_flashing])
if (players[i].flashing)
continue;
if (actor->tracer == players[i].mo) // this was your tracer last time
continue;
@ -13474,7 +13305,7 @@ void A_ItemPop(mobj_t *actor)
S_StartSound(remains, actor->info->deathsound);
if (!((gametyperules & GTR_BUMPERS) && actor->target->player->bumpers <= 0))
actor->target->player->kartstuff[k_itemroulette] = 1;
actor->target->player->itemroulette = 1;
remains->flags2 &= ~MF2_AMBUSH;
@ -13797,9 +13628,9 @@ void A_SPBChase(mobj_t *actor)
if (players[i].respawn.state != RESPAWNST_NONE)
continue;*/ // respawning
if (players[i].kartstuff[k_position] < bestrank)
if (players[i].position < bestrank)
{
bestrank = players[i].kartstuff[k_position];
bestrank = players[i].position;
player = &players[i];
}
}
@ -13832,7 +13663,7 @@ void A_SPBChase(mobj_t *actor)
fixed_t easiness = ((actor->tracer->player->kartspeed + (10-spark)) << FRACBITS) / 2;
actor->lastlook = actor->tracer->player-players; // Save the player num for death scumming...
actor->tracer->player->kartstuff[k_ringlock] = 1; // set ring lock
actor->tracer->player->pflags |= PF_RINGLOCK; // set ring lock
if (!P_IsObjectOnGround(actor->tracer))
{
@ -13850,12 +13681,12 @@ void A_SPBChase(mobj_t *actor)
cy = actor->tracer->player->cmomy;
// Switch targets if you're no longer 1st for long enough
if (actor->tracer->player->kartstuff[k_position] <= bestrank)
if (actor->tracer->player->position <= bestrank)
actor->extravalue2 = 7*TICRATE;
else if (actor->extravalue2-- <= 0)
actor->extravalue1 = 0; // back to SEEKING
spbplace = actor->tracer->player->kartstuff[k_position];
spbplace = actor->tracer->player->position;
}
dist = P_AproxDistance(P_AproxDistance(actor->x-actor->tracer->x, actor->y-actor->tracer->y), actor->z-actor->tracer->z);
@ -13867,7 +13698,7 @@ void A_SPBChase(mobj_t *actor)
wspeed = (3*defspeed)/2;
if (wspeed < 20*actor->tracer->scale)
wspeed = 20*actor->tracer->scale;
if (actor->tracer->player->pflags & PF_SLIDING)
if (actor->tracer->player->carry == CR_SLIDING)
wspeed = actor->tracer->player->speed/2;
// ^^^^ current section: These are annoying, and grand metropolis in particular needs this.
@ -13945,8 +13776,8 @@ void A_SPBChase(mobj_t *actor)
&& !players[actor->lastlook].spectator
&& !players[actor->lastlook].exiting)
{
spbplace = players[actor->lastlook].kartstuff[k_position];
players[actor->lastlook].kartstuff[k_ringlock] = 1;
spbplace = players[actor->lastlook].position;
players[actor->lastlook].pflags |= PF_RINGLOCK;
if (actor->extravalue2-- <= 0 && players[actor->lastlook].mo)
{
P_SetTarget(&actor->tracer, players[actor->lastlook].mo);
@ -14175,7 +14006,7 @@ static inline boolean PIT_SSMineSearch(mobj_t *thing)
if (thing == grenade->target && grenade->threshold != 0) // Don't blow up at your owner.
return true;
if (thing->player && (thing->player->kartstuff[k_hyudorotimer]
if (thing->player && (thing->player->hyudorotimer
|| ((gametyperules & GTR_BUMPERS) && thing->player && thing->player->bumpers <= 0 && thing->player->karmadelay)))
return true;
@ -14417,10 +14248,10 @@ void A_RandomShadowFrame(mobj_t *actor)
// I have NO CLUE how to hardcode all of that fancy Linedef Executor shit so the fire spinout will be done by these entities directly.
if (P_LookForPlayers(actor, false, false, 380<<FRACBITS)) // got target
{
if (actor->target && !actor->target->player->powers[pw_flashing]
&& !actor->target->player->kartstuff[k_invincibilitytimer]
&& !actor->target->player->kartstuff[k_growshrinktimer]
&& !actor->target->player->kartstuff[k_spinouttimer]
if (actor->target && !actor->target->player->flashing
&& !actor->target->player->invincibilitytimer
&& !actor->target->player->growshrinktimer
&& !actor->target->player->spinouttimer
&& P_IsObjectOnGround(actor->target)
&& actor->z == actor->target->z)
{
@ -14462,10 +14293,10 @@ void A_RoamingShadowThinker(mobj_t *actor)
if (P_LookForPlayers(actor, false, false, 256<<FRACBITS)) // got target
{
if (actor->target && !actor->target->player->powers[pw_flashing]
&& !actor->target->player->kartstuff[k_invincibilitytimer]
&& !actor->target->player->kartstuff[k_growshrinktimer]
&& !actor->target->player->kartstuff[k_spinouttimer])
if (actor->target && !actor->target->player->flashing
&& !actor->target->player->invincibilitytimer
&& !actor->target->player->growshrinktimer
&& !actor->target->player->spinouttimer)
{
// send them flying and spawn the WIND!
P_InstaThrust(actor->target, 0, 0);
@ -14703,10 +14534,10 @@ void A_ReaperThinker(mobj_t *actor)
{
if (P_LookForPlayers(actor, false, false, 1024<<FRACBITS)) // got target
{
if (!(actor->target == targetplayermo && actor->target && !actor->target->player->powers[pw_flashing]
&& !actor->target->player->kartstuff[k_invincibilitytimer]
&& !actor->target->player->kartstuff[k_growshrinktimer]
&& !actor->target->player->kartstuff[k_spinouttimer]))
if (!(actor->target == targetplayermo && actor->target && !actor->target->player->flashing
&& !actor->target->player->invincibilitytimer
&& !actor->target->player->growshrinktimer
&& !actor->target->player->spinouttimer))
P_SetTarget(&actor->target, actor->hnext);
// if the above isn't correct, then we should go back to targetting waypoints or something.
}

View file

@ -1555,7 +1555,7 @@ void T_RaiseSector(raise_t *raise)
continue;
// Option to require spindashing.
if (raise->flags & RF_SPINDASH && !(thing->player->pflags & PF_STARTDASH))
if ((raise->flags & RF_SPINDASH) && !thing->player->spindash)
continue;
if (!(thing->z == P_GetSpecialTopZ(thing, raise->sector, sector)))

View file

@ -108,7 +108,7 @@ void P_RampConstant(const BasicFF_t *FFInfo, INT32 Start, INT32 End)
//
boolean P_CanPickupItem(player_t *player, UINT8 weapon)
{
if (player->exiting || mapreset || player->eliminated)
if (player->exiting || mapreset || (player->pflags & PF_ELIMINATED))
return false;
#ifndef OTHERKARMAMODES
@ -122,29 +122,29 @@ boolean P_CanPickupItem(player_t *player, UINT8 weapon)
if (weapon == 2)
{
// Invulnerable
if (player->powers[pw_flashing] > 0)
if (player->flashing > 0)
return false;
// Already have fake
if (player->kartstuff[k_roulettetype] == 2
|| player->kartstuff[k_eggmanexplode])
if (player->roulettetype == 2
|| player->eggmanexplode)
return false;
}
else
{
// Item-specific timer going off
if (player->kartstuff[k_stealingtimer] || player->kartstuff[k_stolentimer]
|| player->kartstuff[k_rocketsneakertimer]
|| player->kartstuff[k_eggmanexplode])
if (player->stealingtimer
|| player->rocketsneakertimer
|| player->eggmanexplode)
return false;
// Item slot already taken up
if (player->kartstuff[k_itemroulette]
|| (weapon != 3 && player->kartstuff[k_itemamount])
|| player->kartstuff[k_itemheld])
if (player->itemroulette
|| (weapon != 3 && player->itemamount)
|| (player->pflags & PF_ITEMOUT))
return false;
if (weapon == 3 && K_GetShieldFromItem(player->kartstuff[k_itemtype]) != KSHIELD_NONE)
if (weapon == 3 && K_GetShieldFromItem(player->itemtype) != KSHIELD_NONE)
return false; // No stacking shields!
}
}
@ -243,16 +243,17 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
P_InstaThrust(player->mo, player->mo->angle, 20<<FRACBITS);
return;
case MT_FLOATINGITEM: // SRB2Kart
if (!P_CanPickupItem(player, 3) || (player->kartstuff[k_itemamount] && player->kartstuff[k_itemtype] != special->threshold))
if (!P_CanPickupItem(player, 3) || (player->itemamount && player->itemtype != special->threshold))
return;
if ((gametyperules & GTR_BUMPERS) && player->bumpers <= 0)
return;
player->kartstuff[k_itemtype] = special->threshold;
player->kartstuff[k_itemamount] += special->movecount;
if (player->kartstuff[k_itemamount] > 255)
player->kartstuff[k_itemamount] = 255;
player->itemtype = special->threshold;
if ((UINT16)(player->itemamount) + special->movecount > 255)
player->itemamount = 255;
else
player->itemamount += special->movecount;
S_StartSound(special, special->info->deathsound);
@ -269,13 +270,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
if ((gametyperules & GTR_BUMPERS) && player->bumpers <= 0)
{
#ifdef OTHERKARMAMODES
if (player->kartstuff[k_comebackmode] || player->karmadelay)
return;
player->kartstuff[k_comebackmode] = 1;
#else
return;
#endif
}
special->momx = special->momy = special->momz = 0;
@ -298,113 +293,30 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
if (special->target->player->karmadelay > 0)
return;
#ifdef OTHERKARMAMODES
if (!special->target->player->kartstuff[k_comebackmode])
{
#endif
mobj_t *boom;
if (P_DamageMobj(toucher, special, special->target, 1, DMG_KARMA) == false)
{
mobj_t *boom;
if (P_DamageMobj(toucher, special, special->target, 1, DMG_KARMA) == false)
{
return;
}
boom = P_SpawnMobj(special->target->x, special->target->y, special->target->z, MT_BOOMEXPLODE);
boom->scale = special->target->scale;
boom->destscale = special->target->scale;
boom->momz = 5*FRACUNIT;
if (special->target->color)
boom->color = special->target->color;
else
boom->color = SKINCOLOR_KETCHUP;
S_StartSound(boom, special->info->attacksound);
special->target->player->karthud[khud_yougotem] = 2*TICRATE;
special->target->player->karmadelay = comebacktime;
}
#ifdef OTHERKARMAMODES
}
else if (special->target->player->kartstuff[k_comebackmode] == 1 && P_CanPickupItem(player, 1))
{
mobj_t *poof = P_SpawnMobj(special->x, special->y, special->z, MT_EXPLODE);
S_StartSound(poof, special->info->seesound);
// Karma fireworks
for (i = 0; i < 5; i++)
{
mobj_t *firework = P_SpawnMobj(special->x, special->y, special->z, MT_KARMAFIREWORK);
firework->momx = (special->target->momx + toucher->momx) / 2;
firework->momy = (special->target->momy + toucher->momy) / 2;
firework->momz = (special->target->momz + toucher->momz) / 2;
P_Thrust(firework, FixedAngle((72*i)<<FRACBITS), P_RandomRange(1,8)*special->scale);
P_SetObjectMomZ(firework, P_RandomRange(1,8)*special->scale, false);
firework->color = special->target->color;
return;
}
special->target->player->kartstuff[k_comebackmode] = 0;
special->target->player->kartstuff[k_comebackpoints]++;
boom = P_SpawnMobj(special->target->x, special->target->y, special->target->z, MT_BOOMEXPLODE);
if (special->target->player->kartstuff[k_comebackpoints] >= 2)
K_StealBumper(special->target->player, player, 1);
special->target->player->karmadelay = comebacktime;
boom->scale = special->target->scale;
boom->destscale = special->target->scale;
boom->momz = 5*FRACUNIT;
player->kartstuff[k_itemroulette] = 1;
player->kartstuff[k_roulettetype] = 1;
}
else if (special->target->player->kartstuff[k_comebackmode] == 2 && P_CanPickupItem(player, 2))
{
mobj_t *poof = P_SpawnMobj(special->x, special->y, special->z, MT_EXPLODE);
UINT8 ptadd = 1; // No WANTED bonus for tricking
S_StartSound(poof, special->info->seesound);
if (player->bumpers == 1) // If you have only one bumper left, and see if it's a 1v1
{
INT32 numingame = 0;
for (i = 0; i < MAXPLAYERS; i++)
{
if (!playeringame[i] || players[i].spectator || players[i].bumpers <= 0)
continue;
numingame++;
}
if (numingame <= 2) // If so, then an extra karma point so they are 100% certain to switch places; it's annoying to end matches with a fake kill
ptadd++;
}
special->target->player->kartstuff[k_comebackmode] = 0;
special->target->player->kartstuff[k_comebackpoints] += ptadd;
if (ptadd > 1)
special->target->player->karthud[khud_yougotem] = 2*TICRATE;
if (special->target->player->kartstuff[k_comebackpoints] >= 2)
K_StealBumper(special->target->player, player, 1);
special->target->player->karmadelay = comebacktime;
K_DropItems(player); //K_StripItems(player);
//K_StripOther(player);
player->kartstuff[k_itemroulette] = 1;
player->kartstuff[k_roulettetype] = 2;
if (special->target->player->kartstuff[k_eggmanblame] >= 0
&& special->target->player->kartstuff[k_eggmanblame] < MAXPLAYERS
&& playeringame[special->target->player->kartstuff[k_eggmanblame]]
&& !players[special->target->player->kartstuff[k_eggmanblame]].spectator)
player->kartstuff[k_eggmanblame] = special->target->player->kartstuff[k_eggmanblame];
if (special->target->color)
boom->color = special->target->color;
else
player->kartstuff[k_eggmanblame] = -1;
boom->color = SKINCOLOR_KETCHUP;
special->target->player->kartstuff[k_eggmanblame] = -1;
S_StartSound(boom, special->info->attacksound);
special->target->player->karthud[khud_yougotem] = 2*TICRATE;
special->target->player->karmadelay = comebacktime;
}
#endif
return;
case MT_SPB:
if ((special->target == toucher || special->target == toucher->target) && (special->threshold > 0))
@ -420,7 +332,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
{
mobj_t *spbexplode;
if (player->kartstuff[k_bubbleblowup] > 0)
if (player->bubbleblowup > 0)
{
K_DropHnextList(player, false);
special->extravalue1 = 2; // WAIT...
@ -452,7 +364,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
if (toucher->hitlag > 0)
return;
player->powers[pw_emeralds] |= special->extravalue1;
player->emeralds |= special->extravalue1;
K_CheckEmeralds(player);
break;
/*
@ -472,16 +384,16 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
return;
// kill
if (player->kartstuff[k_invincibilitytimer] > 0
|| player->kartstuff[k_growshrinktimer] > 0
|| player->kartstuff[k_flamedash] > 0)
if (player->invincibilitytimer > 0
|| player->growshrinktimer > 0
|| player->flamedash > 0)
{
P_KillMobj(special, toucher, toucher, DMG_NORMAL);
return;
}
// no interaction
if (player->powers[pw_flashing] > 0 || player->kartstuff[k_hyudorotimer] > 0 || P_PlayerInPain(player))
if (player->flashing > 0 || player->hyudorotimer > 0 || P_PlayerInPain(player))
return;
// attach to player!
@ -492,8 +404,8 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
if (special->fuse || !P_CanPickupItem(player, 1) || ((gametyperules & GTR_BUMPERS) && player->bumpers <= 0))
return;
player->kartstuff[k_itemroulette] = 1;
player->kartstuff[k_roulettetype] = 1;
player->itemroulette = 1;
player->roulettetype = 1;
// Karma fireworks
for (i = 0; i < 5; i++)
@ -545,7 +457,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
return;
// No picking up rings while SPB is targetting you
if (player->kartstuff[k_ringlock])
if (player->pflags & PF_RINGLOCK)
return;
// Don't immediately pick up spilled rings
@ -564,7 +476,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
special->extravalue1 = 1; // Ring collect animation timer
special->angle = R_PointToAngle2(toucher->x, toucher->y, special->x, special->y); // animation angle
P_SetTarget(&special->target, toucher); // toucher for thinker
player->kartstuff[k_pickuprings]++;
player->pickuprings++;
return;
@ -599,70 +511,6 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
// CTF Flags
case MT_REDFLAG:
case MT_BLUEFLAG:
if (player->powers[pw_flashing] || player->tossdelay)
return;
if (!special->spawnpoint)
return;
if (special->fuse == 1)
return;
// if (special->momz > 0)
// return;
{
UINT8 flagteam = (special->type == MT_REDFLAG) ? 1 : 2;
const char *flagtext;
char flagcolor;
char plname[MAXPLAYERNAME+4];
if (special->type == MT_REDFLAG)
{
flagtext = M_GetText("Red flag");
flagcolor = '\x85';
}
else
{
flagtext = M_GetText("Blue flag");
flagcolor = '\x84';
}
snprintf(plname, sizeof(plname), "%s%s%s",
CTFTEAMCODE(player),
player_names[player - players],
CTFTEAMENDCODE(player));
if (player->ctfteam == flagteam) // Player is on the same team as the flag
{
// Ignore height, only check x/y for now
// avoids stupid problems with some flags constantly returning
if (special->x>>FRACBITS != special->spawnpoint->x
|| special->y>>FRACBITS != special->spawnpoint->y)
{
special->fuse = 1;
special->flags2 |= MF2_JUSTATTACKED;
if (!P_MobjTouchingSectorSpecial(player->mo, 4, 2 + flagteam, false))
{
CONS_Printf(M_GetText("%s returned the %c%s%c to base.\n"), plname, flagcolor, flagtext, 0x80);
// The fuse code plays this sound effect
//if (players[consoleplayer].ctfteam == player->ctfteam)
// S_StartSound(NULL, sfx_hoop1);
}
}
}
else if (player->ctfteam) // Player is on the other team (and not a spectator)
{
UINT16 flagflag = (special->type == MT_REDFLAG) ? GF_REDFLAG : GF_BLUEFLAG;
mobj_t **flagmobj = (special->type == MT_REDFLAG) ? &redflag : &blueflag;
if (player->powers[pw_super])
return;
player->gotflag |= flagflag;
CONS_Printf(M_GetText("%s picked up the %c%s%c!\n"), plname, flagcolor, flagtext, 0x80);
(*flagmobj) = NULL;
// code for dealing with abilities is handled elsewhere now
break;
}
}
return;
case MT_STARPOST:
@ -721,10 +569,9 @@ void P_TouchStarPost(mobj_t *post, player_t *player, boolean snaptopost)
// Player must have touched all previous starposts
if (post->health - player->starpostnum > 1)
{
// blatant reuse of a variable that's normally unused in circuit
if (!player->tossdelay)
if (!player->checkskip)
S_StartSound(toucher, sfx_lose);
player->tossdelay = 3;
player->checkskip = 3;
return;
}
@ -883,7 +730,7 @@ void P_CheckPointLimit(void)
if (!playeringame[i] || players[i].spectator)
continue;
if ((UINT32)cv_pointlimit.value <= players[i].marescore)
if ((UINT32)cv_pointlimit.value <= players[i].roundscore)
{
for (i = 0; i < MAXPLAYERS; i++) // AAAAA nested loop using the same iteration variable ;;
{
@ -929,7 +776,7 @@ boolean P_CheckRacers(void)
numplayersingame++;
if (players[i].exiting || (players[i].pflags & PF_GAMETYPEOVER))
if (players[i].exiting || (players[i].pflags & PF_NOCONTEST))
{
numexiting++;
}
@ -989,7 +836,7 @@ boolean P_CheckRacers(void)
continue;
}
if (players[i].exiting || (players[i].pflags & PF_GAMETYPEOVER))
if (players[i].exiting || (players[i].pflags & PF_NOCONTEST))
{
// You're done, you're free to go.
continue;
@ -1101,39 +948,37 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget
// I wish I knew a better way to do this
if (target->target && target->target->player && target->target->player->mo)
{
if (target->target->player->kartstuff[k_eggmanheld] && target->type == MT_EGGMANITEM_SHIELD)
target->target->player->kartstuff[k_eggmanheld] = 0;
if ((target->target->player->pflags & PF_EGGMANOUT) && target->type == MT_EGGMANITEM_SHIELD)
target->target->player->pflags &= ~PF_EGGMANOUT;
if (target->target->player->kartstuff[k_itemheld])
if (target->target->player->pflags & PF_ITEMOUT)
{
if ((target->type == MT_BANANA_SHIELD && target->target->player->kartstuff[k_itemtype] == KITEM_BANANA) // trail items
|| (target->type == MT_SSMINE_SHIELD && target->target->player->kartstuff[k_itemtype] == KITEM_MINE)
|| (target->type == MT_SINK_SHIELD && target->target->player->kartstuff[k_itemtype] == KITEM_KITCHENSINK))
if ((target->type == MT_BANANA_SHIELD && target->target->player->itemtype == KITEM_BANANA) // trail items
|| (target->type == MT_SSMINE_SHIELD && target->target->player->itemtype == KITEM_MINE)
|| (target->type == MT_SINK_SHIELD && target->target->player->itemtype == KITEM_KITCHENSINK))
{
if (target->movedir != 0 && target->movedir < (UINT16)target->target->player->kartstuff[k_itemamount])
if (target->movedir != 0 && target->movedir < (UINT16)target->target->player->itemamount)
{
if (target->target->hnext)
K_KillBananaChain(target->target->hnext, inflictor, source);
target->target->player->kartstuff[k_itemamount] = 0;
target->target->player->itemamount = 0;
}
else
target->target->player->kartstuff[k_itemamount]--;
else if (target->target->player->itemamount)
target->target->player->itemamount--;
}
else if ((target->type == MT_ORBINAUT_SHIELD && target->target->player->kartstuff[k_itemtype] == KITEM_ORBINAUT) // orbit items
|| (target->type == MT_JAWZ_SHIELD && target->target->player->kartstuff[k_itemtype] == KITEM_JAWZ))
else if ((target->type == MT_ORBINAUT_SHIELD && target->target->player->itemtype == KITEM_ORBINAUT) // orbit items
|| (target->type == MT_JAWZ_SHIELD && target->target->player->itemtype == KITEM_JAWZ))
{
target->target->player->kartstuff[k_itemamount]--;
if (target->target->player->itemamount)
target->target->player->itemamount--;
if (target->lastlook != 0)
{
K_RepairOrbitChain(target);
}
}
if (target->target->player->kartstuff[k_itemamount] < 0)
target->target->player->kartstuff[k_itemamount] = 0;
if (!target->target->player->kartstuff[k_itemamount])
target->target->player->kartstuff[k_itemheld] = 0;
if (!target->target->player->itemamount)
target->target->player->pflags &= ~PF_ITEMOUT;
if (target->target->hnext == target)
P_SetTarget(&target->target->hnext, NULL);
@ -1158,7 +1003,6 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget
UINT8 i;
P_SetTarget(&target->target, source);
source->player->numboxes++;
for (i = 0; i < MAXPLAYERS; i++)
{
@ -1763,11 +1607,10 @@ static boolean P_KillPlayer(player_t *player, mobj_t *inflictor, mobj_t *source,
break;
}
K_DropEmeraldsFromPlayer(player, player->powers[pw_emeralds]);
K_DropEmeraldsFromPlayer(player, player->emeralds);
K_SetHitLagForObjects(player->mo, inflictor, 15);
player->pflags &= ~PF_SLIDING;
player->powers[pw_carry] = CR_NONE;
player->carry = CR_NONE;
player->mo->color = player->skincolor;
player->mo->colorized = false;
@ -1797,7 +1640,7 @@ static boolean P_KillPlayer(player_t *player, mobj_t *inflictor, mobj_t *source,
}
K_DestroyBumpers(player, player->bumpers);
player->eliminated = true;
player->pflags |= PF_ELIMINATED;
}
return true;
@ -1922,7 +1765,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
{
if (gametyperules & GTR_BUMPERS)
{
if ((player->bumpers <= 0 && player->karmadelay) || (player->kartstuff[k_comebackmode] == 1))
if (player->bumpers <= 0 && player->karmadelay)
{
// No bumpers & in WAIT, can't be hurt
K_DoInstashield(player);
@ -1939,7 +1782,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
}
}
if (player->kartstuff[k_invincibilitytimer] > 0 || player->kartstuff[k_growshrinktimer] > 0 || player->kartstuff[k_hyudorotimer] > 0)
if (player->invincibilitytimer > 0 || player->growshrinktimer > 0 || player->hyudorotimer > 0)
{
// Full invulnerability
K_DoInstashield(player);
@ -1948,7 +1791,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
if (combo == false)
{
if (player->powers[pw_flashing] > 0)
if (player->flashing > 0)
{
// Post-hit invincibility
K_DoInstashield(player);
@ -1983,11 +1826,11 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
if (source && source != player->mo && source->player)
{
// Extend the invincibility if the hit was a direct hit.
if (inflictor == source && source->player->kartstuff[k_invincibilitytimer])
if (inflictor == source && source->player->invincibilitytimer)
{
kinvextend = (source->player->kartstuff[k_invincibilitytimer])+5*TICRATE;
//CONS_Printf("extend k_invincibilitytimer for %s - old value %d new value %d\n", player_names[source->player - players], source->player->kartstuff[k_invincibilitytimer]/TICRATE, kinvextend/TICRATE);
source->player->kartstuff[k_invincibilitytimer] = kinvextend;
kinvextend = (source->player->invincibilitytimer)+5*TICRATE;
//CONS_Printf("extend k_invincibilitytimer for %s - old value %d new value %d\n", player_names[source->player - players], source->player->invincibilitytimer/TICRATE, kinvextend/TICRATE);
source->player->invincibilitytimer = kinvextend;
}
K_PlayHitEmSound(source);
@ -2004,8 +1847,8 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
if (damagetype & DMG_STEAL)
{
// Give them ALL of your emeralds instantly :)
source->player->powers[pw_emeralds] |= player->powers[pw_emeralds];
player->powers[pw_emeralds] = 0;
source->player->emeralds |= player->emeralds;
player->emeralds = 0;
K_CheckEmeralds(source->player);
}
}
@ -2017,13 +1860,13 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
if (!(damagetype & DMG_STEAL))
{
// Drop all of your emeralds
K_DropEmeraldsFromPlayer(player, player->powers[pw_emeralds]);
K_DropEmeraldsFromPlayer(player, player->emeralds);
}
}
player->kartstuff[k_sneakertimer] = player->kartstuff[k_numsneakers] = 0;
player->kartstuff[k_driftboost] = 0;
player->kartstuff[k_ringboost] = 0;
player->sneakertimer = player->numsneakers = 0;
player->driftboost = player->strongdriftboost = 0;
player->ringboost = 0;
switch (type)
{
@ -2054,7 +1897,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
if (type != DMG_STING)
{
player->powers[pw_flashing] = K_GetKartFlashing(player);
player->flashing = K_GetKartFlashing(player);
}
P_PlayRinglossSound(player->mo);
@ -2075,7 +1918,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
K_DropHnextList(player, false);
}
player->kartstuff[k_instashield] = 15;
player->instashield = 15;
K_SetHitLagForObjects(target, inflictor, laglength);
return true;
}
@ -2193,7 +2036,7 @@ void P_PlayerRingBurst(player_t *player, INT32 num_rings)
return;
// Have a shield? You get hit, but don't lose your rings!
if (K_GetShieldFromItem(player->kartstuff[k_itemtype]) != KSHIELD_NONE)
if (K_GetShieldFromItem(player->itemtype) != KSHIELD_NONE)
return;
// 20 is the maximum number of rings that can be taken from you at once - half the span of your counter

View file

@ -169,8 +169,6 @@ boolean P_PlayerHitFloor(player_t *player, boolean dorollstuff);
void P_SetObjectMomZ(mobj_t *mo, fixed_t value, boolean relative);
void P_RestoreMusic(player_t *player);
boolean P_EndingMusic(player_t *player);
void P_SpawnShieldOrb(player_t *player);
void P_SwitchShield(player_t *player, UINT16 shieldtype);
mobj_t *P_SpawnGhostMobj(mobj_t *mobj);
INT32 P_GivePlayerRings(player_t *player, INT32 num_rings);
void P_GivePlayerSpheres(player_t *player, INT32 num_spheres);
@ -178,11 +176,6 @@ void P_GivePlayerLives(player_t *player, INT32 numlives);
UINT8 P_GetNextEmerald(void);
void P_GiveEmerald(boolean spawnObj);
void P_GiveFinishFlags(player_t *player);
#if 0
void P_ResetScore(player_t *player);
#else
#define P_ResetScore(player) player->scoreadd = 0
#endif
boolean P_AutoPause(void);
void P_ElementalFire(player_t *player, boolean cropcircle);
@ -287,7 +280,6 @@ boolean P_MobjWasRemoved(mobj_t *th);
void P_RemoveSavegameMobj(mobj_t *th);
boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state);
boolean P_SetMobjState(mobj_t *mobj, statenum_t state);
void P_RunShields(void);
void P_RunOverlays(void);
void P_HandleMinecartSegments(mobj_t *mobj);
void P_MobjThinker(mobj_t *mobj);

View file

@ -350,7 +350,7 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object)
// Less friction when hitting horizontal springs
if (!vertispeed)
{
if (!object->player->kartstuff[k_tiregrease])
if (!object->player->tiregrease)
{
UINT8 i;
for (i = 0; i < 2; i++)
@ -363,7 +363,7 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object)
}
}
object->player->kartstuff[k_tiregrease] = greasetics; //FixedMul(greasetics << FRACBITS, finalSpeed/72) >> FRACBITS
object->player->tiregrease = greasetics; //FixedMul(greasetics << FRACBITS, finalSpeed/72) >> FRACBITS
}
}
@ -387,8 +387,8 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object)
P_ResetPlayer(object->player);
object->player->kartstuff[k_springstars] = max(vertispeed, horizspeed) / FRACUNIT / 2;
object->player->kartstuff[k_springcolor] = starcolor;
object->player->springstars = max(vertispeed, horizspeed) / FRACUNIT / 2;
object->player->springcolor = starcolor;
}
return true;
@ -427,8 +427,6 @@ static void P_DoFanAndGasJet(mobj_t *spring, mobj_t *object)
break;
if (flipval*object->momz >= FixedMul(speed, spring->scale)) // if object's already moving faster than your best, don't bother
break;
if (p && (p->climbing || p->pflags & PF_GLIDING)) // doesn't affect Knux when he's using his abilities!
break;
object->momz += flipval*FixedMul(speed/4, spring->scale);
@ -450,7 +448,7 @@ static void P_DoFanAndGasJet(mobj_t *spring, mobj_t *object)
if (object->player)
{
object->player->trickpanel = 1;
object->player->trickdelay = 1;
object->player->pflags |= PF_TRICKDELAY;
}
K_DoPogoSpring(object, 32<<FRACBITS, 0);
@ -699,8 +697,8 @@ static boolean PIT_CheckThing(mobj_t *thing)
return true;
// Bubble Shield reflect
if (((thing->type == MT_BUBBLESHIELD && thing->target->player && thing->target->player->kartstuff[k_bubbleblowup])
|| (thing->player && thing->player->kartstuff[k_bubbleblowup]))
if (((thing->type == MT_BUBBLESHIELD && thing->target->player && thing->target->player->bubbleblowup)
|| (thing->player && thing->player->bubbleblowup))
&& (tmthing->type == MT_ORBINAUT || tmthing->type == MT_JAWZ || tmthing->type == MT_JAWZ_DUD
|| tmthing->type == MT_BANANA || tmthing->type == MT_EGGMANITEM || tmthing->type == MT_BALLHOG
|| tmthing->type == MT_SSMINE || tmthing->type == MT_LANDMINE || tmthing->type == MT_SINK
@ -724,8 +722,8 @@ static boolean PIT_CheckThing(mobj_t *thing)
P_SetTarget(&tmthing, oldtmthing);*/
if (P_PlayerInPain(tmthing->player)
|| tmthing->player->powers[pw_flashing] || tmthing->player->kartstuff[k_hyudorotimer]
|| tmthing->player->kartstuff[k_justbumped] || tmthing->scale > thing->scale + (mapobjectscale/8))
|| tmthing->player->flashing || tmthing->player->hyudorotimer
|| tmthing->player->justbumped || tmthing->scale > thing->scale + (mapobjectscale/8))
return true;
// Player Damage
@ -757,8 +755,8 @@ static boolean PIT_CheckThing(mobj_t *thing)
// no interaction
return true;
}
else if (((tmthing->type == MT_BUBBLESHIELD && tmthing->target->player && tmthing->target->player->kartstuff[k_bubbleblowup])
|| (tmthing->player && tmthing->player->kartstuff[k_bubbleblowup]))
else if (((tmthing->type == MT_BUBBLESHIELD && tmthing->target->player && tmthing->target->player->bubbleblowup)
|| (tmthing->player && tmthing->player->bubbleblowup))
&& (thing->type == MT_ORBINAUT || thing->type == MT_JAWZ || thing->type == MT_JAWZ_DUD
|| thing->type == MT_BANANA || thing->type == MT_EGGMANITEM || thing->type == MT_BALLHOG
|| thing->type == MT_SSMINE || tmthing->type == MT_LANDMINE || thing->type == MT_SINK
@ -782,8 +780,8 @@ static boolean PIT_CheckThing(mobj_t *thing)
P_SetTarget(&tmthing, oldtmthing);*/
if (P_PlayerInPain(thing->player)
|| thing->player->powers[pw_flashing] || thing->player->kartstuff[k_hyudorotimer]
|| thing->player->kartstuff[k_justbumped] || thing->scale > tmthing->scale + (mapobjectscale/8))
|| thing->player->flashing || thing->player->hyudorotimer
|| thing->player->justbumped || thing->scale > tmthing->scale + (mapobjectscale/8))
return true;
// Player Damage
@ -1237,7 +1235,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
if (tmthing->z + tmthing->height < thing->z)
return true; // underneath
if (thing->player->kartstuff[k_hyudorotimer] || tmthing->player->kartstuff[k_hyudorotimer])
if (thing->player->hyudorotimer || tmthing->player->hyudorotimer)
{
return true;
}
@ -1291,8 +1289,8 @@ static boolean PIT_CheckThing(mobj_t *thing)
if (!thing->health)
return true; // dead
if (tmthing->player->kartstuff[k_invincibilitytimer] > 0
|| tmthing->player->kartstuff[k_growshrinktimer] > 0)
if (tmthing->player->invincibilitytimer > 0
|| tmthing->player->growshrinktimer > 0)
{
if (thing->type == MT_BLUEROBRA_JOINT)
P_KillMobj(thing->target, tmthing, tmthing, DMG_NORMAL);
@ -1317,8 +1315,8 @@ static boolean PIT_CheckThing(mobj_t *thing)
if (!thing->health)
return true; // dead
if (tmthing->player->kartstuff[k_invincibilitytimer] > 0
|| tmthing->player->kartstuff[k_growshrinktimer] > 0)
if (tmthing->player->invincibilitytimer > 0
|| tmthing->player->growshrinktimer > 0)
{
P_KillMobj(thing, tmthing, tmthing, DMG_NORMAL);
return true; // kill
@ -1348,15 +1346,15 @@ static boolean PIT_CheckThing(mobj_t *thing)
return true; // underneath
// kill
if (tmthing->player->kartstuff[k_invincibilitytimer] > 0
|| tmthing->player->kartstuff[k_growshrinktimer] > 0)
if (tmthing->player->invincibilitytimer > 0
|| tmthing->player->growshrinktimer > 0)
{
P_KillMobj(thing, tmthing, tmthing, DMG_NORMAL);
return true;
}
// no interaction
if (tmthing->player->powers[pw_flashing] > 0 || tmthing->player->kartstuff[k_hyudorotimer] > 0 || tmthing->player->kartstuff[k_spinouttimer] > 0)
if (tmthing->player->flashing > 0 || tmthing->player->hyudorotimer > 0 || tmthing->player->spinouttimer > 0)
return true;
// collide
@ -2252,7 +2250,7 @@ boolean P_TryCameraMove(fixed_t x, fixed_t y, camera_t *thiscam)
#ifndef NOCLIPCAM
if ((players[displayplayers[i]].pflags & PF_NOCLIP) || (leveltime < introtime)) // Noclipping player camera noclips too!!
#else
if (!(players[displayplayers[i]].pflags & PF_GAMETYPEOVER)) // Time Over should not clip through walls
if (!(players[displayplayers[i]].pflags & PF_NOCONTEST)) // Time Over should not clip through walls
#endif
{
floatok = true;
@ -2468,7 +2466,7 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff)
const fixed_t maxstepmove = FixedMul(MAXSTEPMOVE, mapobjectscale);
fixed_t maxstep = maxstepmove;
if (thing->player && thing->player->kartstuff[k_waterskip])
if (thing->player && thing->player->waterskip)
maxstep += maxstepmove; // Add some extra stepmove when waterskipping
// If using type Section1:13, double the maxstep.
@ -3197,7 +3195,7 @@ static boolean PTR_SlideTraverse(intercept_t *in)
P_ProcessSpecialSector(slidemo->player, slidemo->subsector->sector, li->polyobj->lines[0]->backsector);
}
if (in->frac < bestslidefrac && (!slidemo->player || !slidemo->player->climbing))
if (in->frac < bestslidefrac)
{
secondslidefrac = bestslidefrac;
secondslideline = bestslideline;

View file

@ -191,7 +191,7 @@ static void P_CyclePlayerMobjState(mobj_t *mobj)
// P_SetPlayerMobjState
// Returns true if the mobj is still present.
//
// Separate from P_SetMobjState because of the pw_flashing check and Super states
// Separate from P_SetMobjState because of the flashing check and Super states
//
boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state)
{
@ -285,7 +285,7 @@ boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state)
if (skin)
{
spr2 = P_GetSkinSprite2(skin, ((player->powers[pw_super] ? FF_SPR2SUPER : 0)|st->frame) & FF_FRAMEMASK, mobj->player);
spr2 = P_GetSkinSprite2(skin, st->frame & FF_FRAMEMASK, mobj->player);
numframes = skin->sprites[spr2].numframes;
}
else
@ -1093,7 +1093,7 @@ fixed_t P_GetMobjGravity(mobj_t *mo)
if (mo->player)
{
if (!(mo->flags2 & MF2_OBJECTFLIP) != !(mo->player->powers[pw_gravityboots])) // negated to turn numeric into bool - would be double negated, but not needed if both would be
if (mo->flags2 & MF2_OBJECTFLIP)
{
gravityadd = -gravityadd;
mo->eflags ^= MFE_VERTICALFLIP;
@ -1104,7 +1104,7 @@ fixed_t P_GetMobjGravity(mobj_t *mo)
P_PlayerFlip(mo);
}
if (mo->player->kartstuff[k_waterskip])
if (mo->player->waterskip)
{
gravityadd = (4*gravityadd)/3;
}
@ -1657,8 +1657,6 @@ void P_XYMovement(mobj_t *mo)
P_SlideMove(mo);
if (player)
player->powers[pw_pushing] = 3;
xmove = ymove = 0;
if (mo->momx || mo->momy) // "Guess" the angle of the wall you hit using new momentum
@ -1677,10 +1675,6 @@ void P_XYMovement(mobj_t *mo)
transferslope->xydirection
+ (transferslope->zangle
& ANGLE_180));
if (player)
{
player->powers[pw_justlaunched] = 2;
}
}
}
}
@ -1809,13 +1803,13 @@ void P_XYMovement(mobj_t *mo)
if (mo->type == MT_FLINGRING || mo->type == MT_BALLHOG || mo->type == MT_BUBBLESHIELDTRAP)
return;
if (player && (player->kartstuff[k_spinouttimer] && !player->kartstuff[k_wipeoutslow])
&& player->speed <= FixedDiv(20*mapobjectscale, player->kartstuff[k_offroad] + FRACUNIT))
if (player && (player->spinouttimer && !player->wipeoutslow)
&& player->speed <= FixedDiv(20*mapobjectscale, player->offroad + FRACUNIT))
return;
//}
if (((!(mo->eflags & MFE_VERTICALFLIP) && mo->z > mo->floorz) || (mo->eflags & MFE_VERTICALFLIP && mo->z+mo->height < mo->ceilingz))
&& !(player && player->pflags & PF_SLIDING))
&& !(player && player->carry == CR_SLIDING))
return; // no friction when airborne
P_XYFriction(mo, oldx, oldy);
@ -2723,7 +2717,7 @@ void P_PlayerZMovement(mobj_t *mo)
mo->z = mo->floorz;
// Get up if you fell.
if (mo->player->panim == PA_HURT && mo->player->kartstuff[k_spinouttimer] == 0 && mo->player->tumbleBounces == 0)
if (mo->player->panim == PA_HURT && mo->player->spinouttimer == 0 && mo->player->tumbleBounces == 0)
P_SetPlayerMobjState(mo, S_KART_STILL);
if (!mo->standingslope && (mo->eflags & MFE_VERTICALFLIP ? tmceilingslope : tmfloorslope)) {
@ -2780,8 +2774,7 @@ void P_PlayerZMovement(mobj_t *mo)
if (CheckForMarioBlocks)
P_CheckMarioBlocks(mo);
if (!mo->player->climbing)
mo->momz = 0;
mo->momz = 0;
}
}
}
@ -2953,7 +2946,7 @@ void P_MobjCheckWater(mobj_t *mobj)
ffloor_t *rover;
player_t *p = mobj->player; // Will just be null if not a player.
fixed_t height = mobj->height;
boolean wasgroundpounding = (p && ((p->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL || (p->powers[pw_shield] & SH_NOSTACK) == SH_BUBBLEWRAP) && (p->pflags & PF_SHIELDABILITY));
boolean wasgroundpounding = false;
// Default if no water exists.
mobj->watertop = mobj->waterbottom = mobj->z - 1000*FRACUNIT;
@ -3013,30 +3006,6 @@ void P_MobjCheckWater(mobj_t *mobj)
if (p && (p->spectator || p->playerstate != PST_LIVE))
return;
// Specific things for underwater players
if (p && (mobj->eflags & MFE_UNDERWATER) == MFE_UNDERWATER)
{
if (!((p->powers[pw_super]) || (p->powers[pw_invulnerability])))
{
boolean electric = !!(p->powers[pw_shield] & SH_PROTECTELECTRIC);
if (electric || ((p->powers[pw_shield] & SH_PROTECTFIRE) && !(p->powers[pw_shield] & SH_PROTECTWATER) && !(mobj->eflags & MFE_TOUCHLAVA)))
{ // Water removes electric and non-water fire shields...
P_FlashPal(p,
electric
? PAL_WHITE
: PAL_NUKE,
1);
p->powers[pw_shield] = p->powers[pw_shield] & SH_STACK;
}
}
if ((wasgroundpounding = ((mobj->eflags & MFE_GOOWATER) && wasgroundpounding)))
{
p->pflags &= ~PF_SHIELDABILITY;
mobj->momz >>= 1;
}
}
// The rest of this code only executes on a water state change.
if (waterwasnotset || !!(mobj->eflags & MFE_UNDERWATER) == wasinwater)
return;
@ -3089,9 +3058,9 @@ void P_MobjCheckWater(mobj_t *mobj)
}
// skipping stone!
if (p && p->kartstuff[k_waterskip] < 2
if (p && p->waterskip < 2
&& ((p->speed/3 > abs(mobj->momz)) // Going more forward than horizontal, so you can skip across the water.
|| (p->speed > 20*mapobjectscale && p->kartstuff[k_waterskip])) // Already skipped once, so you can skip once more!
|| (p->speed > 20*mapobjectscale && p->waterskip)) // Already skipped once, so you can skip once more!
&& ((!(mobj->eflags & MFE_VERTICALFLIP) && thingtop - mobj->momz > mobj->watertop)
|| ((mobj->eflags & MFE_VERTICALFLIP) && mobj->z - mobj->momz < mobj->waterbottom)))
{
@ -3105,7 +3074,7 @@ void P_MobjCheckWater(mobj_t *mobj)
else
mobj->momz = FixedMul(hop, mobj->scale);
p->kartstuff[k_waterskip]++;
p->waterskip++;
}
}
@ -3390,7 +3359,7 @@ boolean P_CameraThinker(player_t *player, camera_t *thiscam, boolean resetcalled
dummy.z = thiscam->z;
dummy.height = thiscam->height;
if ((player->pflags & PF_GAMETYPEOVER) && (gametyperules & GTR_CIRCUIT))
if ((player->pflags & PF_NOCONTEST) && (gametyperules & GTR_CIRCUIT))
{
player->karthud[khud_timeovercam] = (2*TICRATE)+1;
}
@ -3556,7 +3525,7 @@ static void P_PlayerMobjThinker(mobj_t *mobj)
mobj->eflags &= ~MFE_JUSTSTEPPEDDOWN;
// Zoom tube
if ((mobj->player->powers[pw_carry] == CR_ZOOMTUBE && mobj->tracer && !P_MobjWasRemoved(mobj->tracer))
if ((mobj->player->carry == CR_ZOOMTUBE && mobj->tracer && !P_MobjWasRemoved(mobj->tracer))
|| mobj->player->respawn.state == RESPAWNST_MOVE)
{
P_HitSpecialLines(mobj, mobj->x, mobj->y, mobj->momx, mobj->momy);
@ -3574,7 +3543,6 @@ static void P_PlayerMobjThinker(mobj_t *mobj)
// Needed for gravity boots
P_CheckGravity(mobj, false);
mobj->player->powers[pw_justlaunched] = 0;
if (mobj->momx || mobj->momy)
{
P_XYMovement(mobj);
@ -3813,7 +3781,7 @@ boolean P_BossTargetPlayer(mobj_t *actor, boolean closest)
player = &players[actor->lastlook];
if (player->pflags & PF_INVIS || player->bot || player->spectator)
if (player->bot || player->spectator)
continue; // ignore notarget
if (!player->mo || P_MobjWasRemoved(player->mo))
@ -3851,9 +3819,6 @@ boolean P_SupermanLook4Players(mobj_t *actor)
{
if (playeringame[c] && !players[c].spectator)
{
if (players[c].pflags & PF_INVIS)
continue; // ignore notarget
if (!players[c].mo || players[c].bot)
continue;
@ -4467,125 +4432,6 @@ cont:
}
}
static boolean P_ShieldLook(mobj_t *thing, shieldtype_t shield)
{
if (!thing->target || thing->target->health <= 0 || !thing->target->player
|| (thing->target->player->powers[pw_shield] & SH_NOSTACK) == SH_NONE || thing->target->player->powers[pw_super]
|| thing->target->player->powers[pw_invulnerability] > 1)
{
P_RemoveMobj(thing);
return false;
}
// TODO: Make an MT_SHIELDORB which changes color/states to always match the appropriate shield,
// instead of having completely seperate mobjtypes.
if (!(shield & SH_FORCE))
{ // Regular shields check for themselves only
if ((shieldtype_t)(thing->target->player->powers[pw_shield] & SH_NOSTACK) != shield)
{
P_RemoveMobj(thing);
return false;
}
}
else if (!(thing->target->player->powers[pw_shield] & SH_FORCE))
{ // Force shields check for any force shield
P_RemoveMobj(thing);
return false;
}
if (shield & SH_FORCE && thing->movecount != (thing->target->player->powers[pw_shield] & SH_FORCEHP))
{
thing->movecount = (thing->target->player->powers[pw_shield] & SH_FORCEHP);
if (thing->movecount < 1)
{
if (thing->info->painstate)
P_SetMobjState(thing,thing->info->painstate);
else
thing->renderflags |= RF_GHOSTLY;
}
else
{
if (thing->info->painstate)
P_SetMobjState(thing,thing->info->spawnstate);
else
thing->renderflags &= ~(RF_TRANSMASK|RF_BRIGHTMASK);
}
}
thing->flags |= MF_NOCLIPHEIGHT;
thing->eflags = (thing->eflags & ~MFE_VERTICALFLIP)|(thing->target->eflags & MFE_VERTICALFLIP);
P_SetScale(thing, thing->target->scale);
thing->destscale = thing->scale;
P_UnsetThingPosition(thing);
thing->x = thing->target->x;
thing->y = thing->target->y;
if (thing->eflags & MFE_VERTICALFLIP)
thing->z = thing->target->z + (thing->target->height - thing->height - FixedMul(2*FRACUNIT, thing->target->scale));
else
thing->z = thing->target->z + FixedMul(2*FRACUNIT, thing->target->scale);
P_SetThingPosition(thing);
P_CheckPosition(thing, thing->x, thing->y);
if (P_MobjWasRemoved(thing))
return false;
// if (thing->z < thing->floorz)
// thing->z = thing->floorz;
return true;
}
mobj_t *shields[MAXPLAYERS*2];
INT32 numshields = 0;
void P_RunShields(void)
{
INT32 i;
// run shields
for (i = 0; i < numshields; i++)
{
P_ShieldLook(shields[i], shields[i]->threshold);
P_SetTarget(&shields[i], NULL);
}
numshields = 0;
}
static boolean P_AddShield(mobj_t *thing)
{
shieldtype_t shield = thing->threshold;
if (!thing->target || thing->target->health <= 0 || !thing->target->player
|| (thing->target->player->powers[pw_shield] & SH_NOSTACK) == SH_NONE || thing->target->player->powers[pw_super]
|| thing->target->player->powers[pw_invulnerability] > 1)
{
P_RemoveMobj(thing);
return false;
}
if (!(shield & SH_FORCE))
{ // Regular shields check for themselves only
if ((shieldtype_t)(thing->target->player->powers[pw_shield] & SH_NOSTACK) != shield)
{
P_RemoveMobj(thing);
return false;
}
}
else if (!(thing->target->player->powers[pw_shield] & SH_FORCE))
{ // Force shields check for any force shield
P_RemoveMobj(thing);
return false;
}
// Queue has been hit... why?!?
if (numshields >= MAXPLAYERS*2)
return P_ShieldLook(thing, thing->info->speed);
P_SetTarget(&shields[numshields++], thing);
return true;
}
// Kartitem stuff.
boolean P_IsKartItem(INT32 type)
{
@ -5018,9 +4864,6 @@ static void P_MobjSceneryThink(mobj_t *mobj)
if (P_MobjWasRemoved(mobj))
return;
if ((mobj->flags2 & MF2_SHIELD) && !P_AddShield(mobj))
return;
switch (mobj->type)
{
case MT_BOSSJUNK:
@ -5035,6 +4878,10 @@ static void P_MobjSceneryThink(mobj_t *mobj)
case MT_HIDDEN_SLING:
P_MaceSceneryThink(mobj);
break;
case MT_SMALLMACE:
case MT_BIGMACE:
P_SpawnGhostMobj(mobj)->tics = 8;
break;
case MT_HOOP:
if (mobj->fuse > 1)
P_MoveHoop(mobj);
@ -5089,123 +4936,6 @@ static void P_MobjSceneryThink(mobj_t *mobj)
else
P_AddOverlay(mobj);
break;
case MT_PITY_ORB:
case MT_WHIRLWIND_ORB:
case MT_ARMAGEDDON_ORB:
if (!(mobj->flags2 & MF2_SHIELD))
return;
break;
case MT_ATTRACT_ORB:
if (!(mobj->flags2 & MF2_SHIELD))
return;
if (/*(mobj->target) -- the following is implicit by P_AddShield
&& (mobj->target->player)
&& */ (mobj->target->player->homing) && (mobj->target->player->pflags & PF_SHIELDABILITY))
{
P_SetMobjState(mobj, mobj->info->painstate);
mobj->tics++;
}
break;
case MT_ELEMENTAL_ORB:
if (!(mobj->flags2 & MF2_SHIELD))
return;
if (mobj->tracer
/* && mobj->target -- the following is implicit by P_AddShield
&& mobj->target->player
&& (mobj->target->player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL */
&& mobj->target->player->pflags & PF_SHIELDABILITY
&& ((statenum_t)(mobj->tracer->state - states) < mobj->info->raisestate
|| (mobj->tracer->state->nextstate < mobj->info->raisestate && mobj->tracer->tics == 1)))
{
P_SetMobjState(mobj, mobj->info->painstate);
mobj->tics++;
P_SetMobjState(mobj->tracer, mobj->info->raisestate);
mobj->tracer->tics++;
}
break;
case MT_FORCE_ORB:
if (!(mobj->flags2 & MF2_SHIELD))
return;
if (/*
&& mobj->target -- the following is implicit by P_AddShield
&& mobj->target->player
&& (mobj->target->player->powers[pw_shield] & SH_FORCE)
&& */ (mobj->target->player->pflags & PF_SHIELDABILITY))
{
mobj_t *whoosh = P_SpawnMobjFromMobj(mobj, 0, 0, 0, MT_GHOST); // done here so the offset is correct
P_SetMobjState(whoosh, mobj->info->raisestate);
whoosh->destscale = whoosh->scale << 1;
whoosh->scalespeed = FixedMul(whoosh->scalespeed, whoosh->scale);
whoosh->height = 38*whoosh->scale;
whoosh->fuse = 10;
whoosh->flags |= MF_NOCLIPHEIGHT;
whoosh->momz = mobj->target->momz; // Stay reasonably centered for a few frames
mobj->target->player->pflags &= ~PF_SHIELDABILITY; // prevent eternal whoosh
}
/* FALLTHRU */
case MT_FLAMEAURA_ORB:
if (!(mobj->flags2 & MF2_SHIELD))
return;
if ((statenum_t)(mobj->state - states) < mobj->info->painstate)
mobj->angle = mobj->target->angle; // implicitly okay because of P_AddShield
if (mobj->tracer
/* && mobj->target -- the following is implicit by P_AddShield
&& mobj->target->player
&& (mobj->target->player->powers[pw_shield] & SH_NOSTACK) == SH_FLAMEAURA */
&& mobj->target->player->pflags & PF_SHIELDABILITY
&& ((statenum_t)(mobj->tracer->state - states) < mobj->info->raisestate
|| (mobj->tracer->state->nextstate < mobj->info->raisestate && mobj->tracer->tics == 1)))
{
P_SetMobjState(mobj, mobj->info->painstate);
mobj->tics++;
P_SetMobjState(mobj->tracer, mobj->info->raisestate);
mobj->tracer->tics++;
}
break;
case MT_BUBBLEWRAP_ORB:
if (!(mobj->flags2 & MF2_SHIELD))
return;
if (mobj->tracer
/* && mobj->target -- the following is implicit by P_AddShield
&& mobj->target->player
&& (mobj->target->player->powers[pw_shield] & SH_NOSTACK) == SH_BUBBLEWRAP */
)
{
if (mobj->target->player->pflags & PF_SHIELDABILITY
&& ((statenum_t)(mobj->state - states) < mobj->info->painstate
|| (mobj->state->nextstate < mobj->info->painstate && mobj->tics == 1)))
{
P_SetMobjState(mobj, mobj->info->painstate);
mobj->tics++;
P_SetMobjState(mobj->tracer, mobj->info->raisestate);
mobj->tracer->tics++;
}
else if (mobj->target->eflags & MFE_JUSTHITFLOOR
&& (statenum_t)(mobj->state - states) == mobj->info->painstate)
{
P_SetMobjState(mobj, mobj->info->painstate + 1);
mobj->tics++;
P_SetMobjState(mobj->tracer, mobj->info->raisestate + 1);
mobj->tracer->tics++;
}
}
break;
case MT_THUNDERCOIN_ORB:
if (!(mobj->flags2 & MF2_SHIELD))
return;
if (mobj->tracer
/* && mobj->target -- the following is implicit by P_AddShield
&& mobj->target->player
&& (mobj->target->player->powers[pw_shield] & SH_NOSTACK) == SH_THUNDERCOIN */
&& (mobj->target->player->pflags & PF_SHIELDABILITY))
{
P_SetMobjState(mobj, mobj->info->painstate);
mobj->tics++;
P_SetMobjState(mobj->tracer, mobj->info->raisestate);
mobj->tracer->tics++;
mobj->target->player->pflags &= ~PF_SHIELDABILITY; // prevent eternal spark
}
break;
case MT_WATERDROP:
P_SceneryCheckWater(mobj);
if ((mobj->z <= mobj->floorz || mobj->z <= mobj->watertop)
@ -5658,7 +5388,7 @@ static void P_MobjSceneryThink(mobj_t *mobj)
}
// Do this in an easy way
if (mobj->target->player->kartstuff[k_itemroulette])
if (mobj->target->player->itemroulette)
{
mobj->tracer->color = mobj->target->player->skincolor;
mobj->tracer->colorized = true;
@ -5671,17 +5401,17 @@ static void P_MobjSceneryThink(mobj_t *mobj)
if (!(mobj->renderflags & RF_DONTDRAW))
{
const INT32 numberdisplaymin = ((mobj->target->player->kartstuff[k_itemtype] == KITEM_ORBINAUT) ? 5 : 2);
const INT32 numberdisplaymin = ((mobj->target->player->itemtype == KITEM_ORBINAUT) ? 5 : 2);
// Set it to use the correct states for its condition
if (mobj->target->player->kartstuff[k_itemroulette])
if (mobj->target->player->itemroulette)
{
P_SetMobjState(mobj, S_PLAYERARROW_BOX);
mobj->tracer->sprite = SPR_ITEM;
mobj->tracer->frame = FF_FULLBRIGHT|(((mobj->target->player->kartstuff[k_itemroulette] % (13*3)) / 3) + 1);
mobj->tracer->frame = FF_FULLBRIGHT|(((mobj->target->player->itemroulette % (13*3)) / 3) + 1);
mobj->tracer->renderflags &= ~RF_DONTDRAW;
}
else if (mobj->target->player->kartstuff[k_stolentimer] > 0)
else if (mobj->target->player->stealingtimer < 0)
{
P_SetMobjState(mobj, S_PLAYERARROW_BOX);
mobj->tracer->sprite = SPR_ITEM;
@ -5691,14 +5421,14 @@ static void P_MobjSceneryThink(mobj_t *mobj)
else
mobj->tracer->renderflags |= RF_DONTDRAW;
}
else if ((mobj->target->player->kartstuff[k_stealingtimer] > 0) && (leveltime & 2))
else if ((mobj->target->player->stealingtimer > 0) && (leveltime & 2))
{
P_SetMobjState(mobj, S_PLAYERARROW_BOX);
mobj->tracer->sprite = SPR_ITEM;
mobj->tracer->frame = FF_FULLBRIGHT|KITEM_HYUDORO;
mobj->tracer->renderflags &= ~RF_DONTDRAW;
}
else if (mobj->target->player->kartstuff[k_eggmanexplode] > 1)
else if (mobj->target->player->eggmanexplode > 1)
{
P_SetMobjState(mobj, S_PLAYERARROW_BOX);
mobj->tracer->sprite = SPR_ITEM;
@ -5708,9 +5438,9 @@ static void P_MobjSceneryThink(mobj_t *mobj)
else
mobj->tracer->renderflags |= RF_DONTDRAW;
}
else if (mobj->target->player->kartstuff[k_rocketsneakertimer] > 1)
else if (mobj->target->player->rocketsneakertimer > 1)
{
//itembar = mobj->target->player->kartstuff[k_rocketsneakertimer]; -- not today satan
//itembar = mobj->target->player->rocketsneakertimer; -- not today satan
P_SetMobjState(mobj, S_PLAYERARROW_BOX);
mobj->tracer->sprite = SPR_ITEM;
mobj->tracer->frame = FF_FULLBRIGHT|KITEM_ROCKETSNEAKER;
@ -5719,15 +5449,15 @@ static void P_MobjSceneryThink(mobj_t *mobj)
else
mobj->tracer->renderflags |= RF_DONTDRAW;
}
else if (mobj->target->player->kartstuff[k_itemtype] && mobj->target->player->kartstuff[k_itemamount] > 0)
else if (mobj->target->player->itemtype && mobj->target->player->itemamount > 0)
{
P_SetMobjState(mobj, S_PLAYERARROW_BOX);
switch (mobj->target->player->kartstuff[k_itemtype])
switch (mobj->target->player->itemtype)
{
case KITEM_ORBINAUT:
mobj->tracer->sprite = SPR_ITMO;
mobj->tracer->frame = FF_FULLBRIGHT|(min(mobj->target->player->kartstuff[k_itemamount]-1, 3));
mobj->tracer->frame = FF_FULLBRIGHT|(min(mobj->target->player->itemamount-1, 3));
break;
case KITEM_INVINCIBILITY:
mobj->tracer->sprite = SPR_ITMI;
@ -5739,11 +5469,11 @@ static void P_MobjSceneryThink(mobj_t *mobj)
break;
default:
mobj->tracer->sprite = SPR_ITEM;
mobj->tracer->frame = FF_FULLBRIGHT|(mobj->target->player->kartstuff[k_itemtype]);
mobj->tracer->frame = FF_FULLBRIGHT|(mobj->target->player->itemtype);
break;
}
if (mobj->target->player->kartstuff[k_itemheld])
if (mobj->target->player->pflags & PF_ITEMOUT)
{
if (leveltime & 1)
mobj->tracer->renderflags &= ~RF_DONTDRAW;
@ -5761,8 +5491,8 @@ static void P_MobjSceneryThink(mobj_t *mobj)
mobj->tracer->destscale = scale;
if (mobj->target->player->kartstuff[k_itemamount] >= numberdisplaymin
&& mobj->target->player->kartstuff[k_itemamount] <= 10) // Meh, too difficult to support greater than this; convert this to a decent HUD object and then maybe :V
if (mobj->target->player->itemamount >= numberdisplaymin
&& mobj->target->player->itemamount <= 10) // Meh, too difficult to support greater than this; convert this to a decent HUD object and then maybe :V
{
mobj_t *number = P_SpawnMobj(mobj->x, mobj->y, mobj->z, MT_OVERLAY);
mobj_t *numx = P_SpawnMobj(mobj->x, mobj->y, mobj->z, MT_OVERLAY);
@ -5771,7 +5501,7 @@ static void P_MobjSceneryThink(mobj_t *mobj)
P_SetMobjState(number, S_PLAYERARROW_NUMBER);
P_SetScale(number, mobj->scale);
number->destscale = scale;
number->frame = FF_FULLBRIGHT|(mobj->target->player->kartstuff[k_itemamount]);
number->frame = FF_FULLBRIGHT|(mobj->target->player->itemamount);
P_SetTarget(&numx->target, mobj);
P_SetMobjState(numx, S_PLAYERARROW_X);
@ -5872,6 +5602,7 @@ static void P_MobjSceneryThink(mobj_t *mobj)
mobj->renderflags ^= RF_DONTDRAW;
break;
case MT_SPINDASHWIND:
case MT_DRIFTELECTRICSPARK:
mobj->renderflags ^= RF_DONTDRAW;
break;
case MT_VWREF:
@ -6743,7 +6474,9 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
}
else if (mobj->fuse <= 32)
mobj->color = SKINCOLOR_SAPPHIRE;
else if (mobj->fuse > 32)
else if (mobj->fuse <= 48)
mobj->color = SKINCOLOR_PURPLE;
else if (mobj->fuse > 48)
mobj->color = K_RainbowColor(
(SKINCOLOR_PURPLE - SKINCOLOR_PINK) // Smoothly transition into the other state
+ ((mobj->fuse - 32) * 2) // Make the color flashing slow down while it runs out
@ -6751,7 +6484,7 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
switch (mobj->extravalue1)
{
case 3:/* rainbow boost */
case 4:/* rainbow boost */
/* every 20 tics, bang! */
if (( 120 - mobj->fuse ) % 10 == 0)
{
@ -6760,6 +6493,12 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
}
break;
case 3:/* purple boost */
if ((mobj->fuse == 32)/* to blue*/
|| (mobj->fuse == 16))/* to red*/
K_SpawnDriftBoostClip(mobj->target->player);
break;
case 2:/* blue boost */
if (mobj->fuse == 16)/* to red*/
K_SpawnDriftBoostClip(mobj->target->player);
@ -6779,12 +6518,12 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
if (p)
{
if (p->kartstuff[k_driftboost] > mobj->movecount)
if (p->driftboost > mobj->movecount)
{
; // reset animation
}
mobj->movecount = p->kartstuff[k_driftboost];
mobj->movecount = p->driftboost;
}
}
break;
@ -6812,9 +6551,9 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
if (p)
{
if (p->kartstuff[k_sneakertimer] > mobj->movecount)
if (p->sneakertimer > mobj->movecount)
P_SetMobjState(mobj, S_BOOSTFLAME);
mobj->movecount = p->kartstuff[k_sneakertimer];
mobj->movecount = p->sneakertimer;
}
}
@ -6843,7 +6582,7 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
mobj->colorized = mobj->target->colorized;
break;
case MT_INVULNFLASH:
if (!mobj->target || !mobj->target->health || (mobj->target->player && !mobj->target->player->kartstuff[k_invincibilitytimer]))
if (!mobj->target || !mobj->target->health || (mobj->target->player && !mobj->target->player->invincibilitytimer))
{
P_RemoveMobj(mobj);
return false;
@ -6852,7 +6591,7 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
break;
case MT_BRAKEDRIFT:
if ((!mobj->target || !mobj->target->health || !mobj->target->player || !P_IsObjectOnGround(mobj->target))
|| !mobj->target->player->kartstuff[k_drift] || !mobj->target->player->kartstuff[k_brakedrift]
|| !mobj->target->player->drift || !(mobj->target->player->pflags & PF_BRAKEDRIFT)
|| !((mobj->target->player->cmd.buttons & BT_BRAKE)
|| (K_GetKartButtons(mobj->target->player) & BT_ACCELERATE))) // Letting go of accel functions about the same as brake-drifting
{
@ -6861,17 +6600,17 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
}
else
{
UINT8 driftcolor = K_DriftSparkColor(mobj->target->player, mobj->target->player->kartstuff[k_driftcharge]);
UINT8 driftcolor = K_DriftSparkColor(mobj->target->player, mobj->target->player->driftcharge);
fixed_t newx, newy;
angle_t travelangle;
travelangle = mobj->target->angle - ((ANGLE_45/5)*mobj->target->player->kartstuff[k_drift]);
travelangle = mobj->target->angle - ((ANGLE_45/5)*mobj->target->player->drift);
newx = mobj->target->x + P_ReturnThrustX(mobj->target, travelangle+ANGLE_180, 24*mobj->target->scale);
newy = mobj->target->y + P_ReturnThrustY(mobj->target, travelangle+ANGLE_180, 24*mobj->target->scale);
P_TeleportMove(mobj, newx, newy, mobj->target->z);
mobj->angle = travelangle - ((ANGLE_90/5)*mobj->target->player->kartstuff[k_drift]);
mobj->angle = travelangle - ((ANGLE_90/5)*mobj->target->player->drift);
P_SetScale(mobj, (mobj->destscale = mobj->target->scale));
if (driftcolor != SKINCOLOR_NONE)
@ -6915,7 +6654,7 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
K_MatchGenericExtraFlags(mobj, mobj->target);
/* FALLTHRU */
case MT_INSTASHIELDA:
if (!mobj->target || !mobj->target->health || (mobj->target->player && !mobj->target->player->kartstuff[k_instashield]))
if (!mobj->target || !mobj->target->health || (mobj->target->player && !mobj->target->player->instashield))
{
P_RemoveMobj(mobj);
return false;
@ -6986,7 +6725,7 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
break;
case MT_TIREGREASE:
if (!mobj->target || P_MobjWasRemoved(mobj->target) || !mobj->target->player
|| !mobj->target->player->kartstuff[k_tiregrease])
|| !mobj->target->player->tiregrease)
{
P_RemoveMobj(mobj);
return false;
@ -6998,7 +6737,7 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
const angle_t off = FixedAngle(40*FRACUNIT);
angle_t ang = K_MomentumAngle(mobj->target);
fixed_t z;
UINT8 trans = (mobj->target->player->kartstuff[k_tiregrease] * (NUMTRANSMAPS+1)) / greasetics;
UINT8 trans = (mobj->target->player->tiregrease * (NUMTRANSMAPS+1)) / greasetics;
if (trans > NUMTRANSMAPS)
trans = NUMTRANSMAPS;
@ -7035,7 +6774,7 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
{
fixed_t destx, desty;
if (!mobj->target || !mobj->target->health || !mobj->target->player
|| mobj->target->player->kartstuff[k_curshield] != KSHIELD_THUNDER)
|| mobj->target->player->curshield != KSHIELD_THUNDER)
{
P_RemoveMobj(mobj);
return false;
@ -7076,7 +6815,7 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
statenum_t curstate;
if (!mobj->target || !mobj->target->health || !mobj->target->player
|| mobj->target->player->kartstuff[k_curshield] != KSHIELD_BUBBLE)
|| mobj->target->player->curshield != KSHIELD_BUBBLE)
{
P_RemoveMobj(mobj);
return false;
@ -7085,9 +6824,9 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
scale = (5*mobj->target->scale)>>2;
curstate = ((mobj->tics == 1) ? (mobj->state->nextstate) : ((statenum_t)(mobj->state-states)));
if (mobj->target->player->kartstuff[k_bubbleblowup])
if (mobj->target->player->bubbleblowup)
{
INT32 blow = mobj->target->player->kartstuff[k_bubbleblowup];
INT32 blow = mobj->target->player->bubbleblowup;
if (blow > bubbletime)
blow = bubbletime;
@ -7099,7 +6838,7 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
scale += (blow * (3*scale)) / bubbletime;
mobj->frame = (states[S_BUBBLESHIELDBLOWUP].frame + mobj->extravalue1);
if ((mobj->target->player->kartstuff[k_bubbleblowup] > bubbletime) && (leveltime & 1))
if ((mobj->target->player->bubbleblowup > bubbletime) && (leveltime & 1))
mobj->frame = (states[S_BUBBLESHIELDBLOWUP].frame + 5);
if (mobj->extravalue1 < 4 && mobj->extravalue2 < blow && !mobj->cvmem && (leveltime & 1)) // Growing
@ -7164,14 +6903,14 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
}
else
{
if (mobj->target->player->kartstuff[k_bubblecool] && ((curstate-S_BUBBLESHIELD1) & 1))
if (mobj->target->player->bubblecool && ((curstate-S_BUBBLESHIELD1) & 1))
mobj->renderflags |= RF_GHOSTLY;
else
mobj->renderflags &= ~RF_GHOSTLYMASK;
}
}
mobj->extravalue2 = mobj->target->player->kartstuff[k_bubbleblowup];
mobj->extravalue2 = mobj->target->player->bubbleblowup;
P_SetScale(mobj, (mobj->destscale = scale));
if (!splitscreen /*&& rendermode != render_soft*/)
@ -7205,19 +6944,19 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
INT32 flamemax = 0;
if (!mobj->target || !mobj->target->health || !mobj->target->player
|| mobj->target->player->kartstuff[k_curshield] != KSHIELD_FLAME)
|| mobj->target->player->curshield != KSHIELD_FLAME)
{
P_RemoveMobj(mobj);
return false;
}
flamemax = mobj->target->player->kartstuff[k_flamelength] * flameseg;
flamemax = mobj->target->player->flamelength * flameseg;
P_SetScale(mobj, (mobj->destscale = (5*mobj->target->scale)>>2));
curstate = ((mobj->tics == 1) ? (mobj->state->nextstate) : ((statenum_t)(mobj->state-states)));
if (mobj->target->player->kartstuff[k_flamedash])
if (mobj->target->player->flamedash)
{
if (!(curstate >= S_FLAMESHIELDDASH1 && curstate <= S_FLAMESHIELDDASH12))
P_SetMobjState(mobj, S_FLAMESHIELDDASH1);
@ -7236,7 +6975,7 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
UINT8 i;
UINT8 nl = 2;
if (mobj->target->player->kartstuff[k_flamedash] > mobj->extravalue1)
if (mobj->target->player->flamedash > mobj->extravalue1)
nl = 3;
for (i = 0; i < nl; i++)
@ -7262,9 +7001,9 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
P_SetMobjState(mobj, S_FLAMESHIELD1);
}
mobj->extravalue1 = mobj->target->player->kartstuff[k_flamedash];
mobj->extravalue1 = mobj->target->player->flamedash;
if (mobj->target->player->kartstuff[k_flamemeter] > flamemax)
if (mobj->target->player->flamemeter > flamemax)
{
mobj_t *flash = P_SpawnMobj(mobj->x + mobj->target->momx, mobj->y + mobj->target->momy, mobj->z + mobj->target->momz, MT_THOK);
P_SetMobjState(flash, S_FLAMESHIELDFLASH);
@ -7319,7 +7058,7 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
P_RemoveMobj(mobj);
return false;
}
if (mobj->target->player && !mobj->target->player->kartstuff[k_rocketsneakertimer])
if (mobj->target->player && !mobj->target->player->rocketsneakertimer)
{
mobj->flags &= ~MF_NOGRAVITY;
mobj->angle += ANGLE_45;
@ -7354,11 +7093,7 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
mobj->color = mobj->target->color;
mobj->colorized = true;
// Give items an item-sized hitbox
if (mobj->target->player->kartstuff[k_comebackmode] == 1)
mobj->radius = 48*mobj->target->scale;
else
mobj->radius = 24*mobj->target->scale;
mobj->radius = 24*mobj->target->scale;
mobj->height = 2*mobj->radius;
if (mobj->target->player->karmadelay > 0)
@ -7372,17 +7107,10 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
}
else
{
if (!mobj->target->player->kartstuff[k_comebackmode]
&& (state < S_PLAYERBOMB1 || state > S_PLAYERBOMB20))
if (state < S_PLAYERBOMB1 || state > S_PLAYERBOMB20)
P_SetMobjState(mobj, S_PLAYERBOMB1);
else if (mobj->target->player->kartstuff[k_comebackmode] == 1
&& (state < S_PLAYERITEM1 || state > S_PLAYERITEM12))
P_SetMobjState(mobj, S_PLAYERITEM1);
else if (mobj->target->player->kartstuff[k_comebackmode] == 2
&& (state < S_PLAYERFAKE1 || state > S_PLAYERFAKE12))
P_SetMobjState(mobj, S_PLAYERFAKE1);
if (mobj->target->player->powers[pw_flashing] && (leveltime & 1))
if (mobj->target->player->flashing && (leveltime & 1))
mobj->renderflags |= RF_DONTDRAW;
else
mobj->renderflags &= ~RF_DONTDRAW;
@ -7952,7 +7680,7 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
player_t *player = mobj->target->player;
mobj->extravalue1 = 1;
player->kartstuff[k_offroad] += 2<<FRACBITS;
player->offroad += 2<<FRACBITS;
P_TeleportMove(mobj,
player->mo->x + P_ReturnThrustX(NULL, player->mo->angle, player->mo->radius)
@ -7971,6 +7699,7 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
break;
}
// Uses cmd.turning over steering intentionally.
if (abs(player->cmd.turning) > 100)
{
INT32 lastsign = 0;
@ -8127,6 +7856,7 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
break;
}
// Uses cmd.turning over steering intentionally.
if (abs(player->cmd.turning) > 100)
{
INT32 lastsign = 0;
@ -8764,15 +8494,15 @@ void P_MobjThinker(mobj_t *mobj)
{
if (mobj->flags2 & MF2_BOSSNOTRAP) // "fast" flag
{
if ((signed)((mobj->frame & FF_TRANSMASK) >> FF_TRANSSHIFT) < (NUMTRANSMAPS-1) - (2*mobj->fuse)/3)
if ((signed)((mobj->renderflags & RF_TRANSMASK) >> RF_TRANSSHIFT) < (NUMTRANSMAPS-1) - (2*mobj->fuse)/3)
// fade out when nearing the end of fuse...
mobj->frame = (mobj->frame & ~FF_TRANSMASK) | (((NUMTRANSMAPS-1) - (2*mobj->fuse)/3) << FF_TRANSSHIFT);
mobj->renderflags = (mobj->renderflags & ~RF_TRANSMASK) | (((NUMTRANSMAPS-1) - (2*mobj->fuse)/3) << RF_TRANSSHIFT);
}
else
{
if ((signed)((mobj->frame & FF_TRANSMASK) >> FF_TRANSSHIFT) < (NUMTRANSMAPS-1) - mobj->fuse / 2)
if ((signed)((mobj->renderflags & RF_TRANSMASK) >> RF_TRANSSHIFT) < (NUMTRANSMAPS-1) - mobj->fuse / 2)
// fade out when nearing the end of fuse...
mobj->frame = (mobj->frame & ~FF_TRANSMASK) | (((NUMTRANSMAPS-1) - mobj->fuse / 2) << FF_TRANSSHIFT);
mobj->renderflags = (mobj->frame & ~RF_TRANSMASK) | (((NUMTRANSMAPS-1) - mobj->fuse / 2) << RF_TRANSSHIFT);
}
}
@ -9161,7 +8891,7 @@ void P_SceneryThinker(mobj_t *mobj)
if (!playeringame[mobj->threshold] || players[mobj->threshold].spectator) // focused on a valid player?
return;
if (!(players[mobj->threshold].exiting) && !(players[mobj->threshold].pflags & PF_GAMETYPEOVER)) // not finished yet?
if (!(players[mobj->threshold].exiting) && !(players[mobj->threshold].pflags & PF_NOCONTEST)) // not finished yet?
return;
if (K_IsPlayerLosing(&players[mobj->threshold]))
@ -10495,7 +10225,7 @@ void P_SpawnPlayer(INT32 playernum)
}
if (leveltime > introtime)
p->powers[pw_flashing] = K_GetKartFlashing(p); // Babysitting deterrent
p->flashing = K_GetKartFlashing(p); // Babysitting deterrent
mobj = P_SpawnMobj(0, 0, 0, MT_PLAYER);
(mobj->player = p)->mo = mobj;
@ -10514,7 +10244,6 @@ void P_SpawnPlayer(INT32 playernum)
mobj->health = 1;
p->playerstate = PST_LIVE;
p->bonustime = false;
p->realtime = leveltime;
p->followitem = skins[p->skin].followitem;
@ -12301,7 +12030,7 @@ void P_SpawnHoop(mapthing_t *mthing)
P_SpawnHoopInternal(mthing, 8 + (4*(mthing->options & 0xF)), 4*FRACUNIT);
}
static void P_SpawnItemRow(mapthing_t *mthing, mobjtype_t* itemtypes, UINT8 numitemtypes, INT32 numitems, fixed_t horizontalspacing, fixed_t verticalspacing, INT16 fixedangle, boolean bonustime)
static void P_SpawnItemRow(mapthing_t *mthing, mobjtype_t* itemtypes, UINT8 numitemtypes, INT32 numitems, fixed_t horizontalspacing, fixed_t verticalspacing, INT16 fixedangle)
{
mapthing_t dummything;
mobj_t *mobj = NULL;
@ -12312,8 +12041,6 @@ static void P_SpawnItemRow(mapthing_t *mthing, mobjtype_t* itemtypes, UINT8 numi
angle_t angle = FixedAngle(fixedangle << FRACBITS);
angle_t fineangle = (angle >> ANGLETOFINESHIFT) & FINEMASK;
(void)bonustime;
for (r = 0; r < numitemtypes; r++)
{
dummything = *mthing;
@ -12352,13 +12079,13 @@ static void P_SpawnItemRow(mapthing_t *mthing, mobjtype_t* itemtypes, UINT8 numi
}
}
static void P_SpawnSingularItemRow(mapthing_t* mthing, mobjtype_t itemtype, INT32 numitems, fixed_t horizontalspacing, fixed_t verticalspacing, INT16 fixedangle, boolean bonustime)
static void P_SpawnSingularItemRow(mapthing_t* mthing, mobjtype_t itemtype, INT32 numitems, fixed_t horizontalspacing, fixed_t verticalspacing, INT16 fixedangle)
{
mobjtype_t itemtypes[1] = { itemtype };
return P_SpawnItemRow(mthing, itemtypes, 1, numitems, horizontalspacing, verticalspacing, fixedangle, bonustime);
return P_SpawnItemRow(mthing, itemtypes, 1, numitems, horizontalspacing, verticalspacing, fixedangle);
}
static void P_SpawnItemCircle(mapthing_t *mthing, mobjtype_t *itemtypes, UINT8 numitemtypes, INT32 numitems, fixed_t size, boolean bonustime)
static void P_SpawnItemCircle(mapthing_t *mthing, mobjtype_t *itemtypes, UINT8 numitemtypes, INT32 numitems, fixed_t size)
{
mapthing_t dummything;
mobj_t* mobj = NULL;
@ -12370,8 +12097,6 @@ static void P_SpawnItemCircle(mapthing_t *mthing, mobjtype_t *itemtypes, UINT8 n
INT32 i;
TVector v, *res;
(void)bonustime;
for (i = 0; i < numitemtypes; i++)
{
dummything = *mthing;
@ -12416,22 +12141,22 @@ static void P_SpawnItemCircle(mapthing_t *mthing, mobjtype_t *itemtypes, UINT8 n
}
}
void P_SpawnItemPattern(mapthing_t *mthing, boolean bonustime)
void P_SpawnItemPattern(mapthing_t *mthing)
{
switch (mthing->type)
{
// Special placement patterns
case 600: // 5 vertical rings (yellow spring)
P_SpawnSingularItemRow(mthing, MT_RING, 5, 0, 64*FRACUNIT, 0, bonustime);
P_SpawnSingularItemRow(mthing, MT_RING, 5, 0, 64*FRACUNIT, 0);
return;
case 601: // 5 vertical rings (red spring)
P_SpawnSingularItemRow(mthing, MT_RING, 5, 0, 128*FRACUNIT, 0, bonustime);
P_SpawnSingularItemRow(mthing, MT_RING, 5, 0, 128*FRACUNIT, 0);
return;
case 602: // 5 diagonal rings (yellow spring)
P_SpawnSingularItemRow(mthing, MT_RING, 5, 64*FRACUNIT, 64*FRACUNIT, mthing->angle, bonustime);
P_SpawnSingularItemRow(mthing, MT_RING, 5, 64*FRACUNIT, 64*FRACUNIT, mthing->angle);
return;
case 603: // 10 diagonal rings (red spring)
P_SpawnSingularItemRow(mthing, MT_RING, 10, 64*FRACUNIT, 64*FRACUNIT, mthing->angle, bonustime);
P_SpawnSingularItemRow(mthing, MT_RING, 10, 64*FRACUNIT, 64*FRACUNIT, mthing->angle);
return;
case 604: // Circle of rings (8 items)
case 605: // Circle of rings (16 items)
@ -12439,7 +12164,7 @@ void P_SpawnItemPattern(mapthing_t *mthing, boolean bonustime)
INT32 numitems = (mthing->type & 1) ? 16 : 8;
fixed_t size = (mthing->type & 1) ? 192*FRACUNIT : 96*FRACUNIT;
mobjtype_t itemtypes[1] = { MT_RING };
P_SpawnItemCircle(mthing, itemtypes, 1, numitems, size, bonustime);
P_SpawnItemCircle(mthing, itemtypes, 1, numitems, size);
return;
}
default:

View file

@ -487,7 +487,7 @@ fixed_t P_GetMapThingSpawnHeight(const mobjtype_t mobjtype, const mapthing_t* mt
mobj_t *P_SpawnMapThing(mapthing_t *mthing);
void P_SpawnHoop(mapthing_t *mthing);
void P_SpawnItemPattern(mapthing_t *mthing, boolean bonustime);
void P_SpawnItemPattern(mapthing_t *mthing);
void P_SpawnHoopOfSomething(fixed_t x, fixed_t y, fixed_t z, fixed_t radius, INT32 number, mobjtype_t type, angle_t rotangle);
void P_SpawnPrecipitation(void);
void P_SpawnParaloop(fixed_t x, fixed_t y, fixed_t z, fixed_t radius, INT32 number, mobjtype_t type, statenum_t nstate, angle_t rotangle, boolean spawncenter);

View file

@ -73,7 +73,6 @@ static inline void P_ArchivePlayer(void)
WRITEUINT8(save_p, numgameovers);
WRITESINT8(save_p, pllives);
WRITEUINT32(save_p, player->score);
WRITEINT32(save_p, player->continues);
}
static inline void P_UnArchivePlayer(void)
@ -84,7 +83,6 @@ static inline void P_UnArchivePlayer(void)
savedata.numgameovers = READUINT8(save_p);
savedata.lives = READSINT8(save_p);
savedata.score = READUINT32(save_p);
savedata.continues = READINT32(save_p);
}
static void P_NetArchivePlayers(void)
@ -129,18 +127,15 @@ static void P_NetArchivePlayers(void)
WRITEANGLE(save_p, players[i].aiming);
WRITEANGLE(save_p, players[i].drawangle);
WRITEANGLE(save_p, players[i].viewrollangle);
WRITEANGLE(save_p, players[i].tilt);
WRITEANGLE(save_p, players[i].awayviewaiming);
WRITEINT32(save_p, players[i].awayviewtics);
WRITEINT16(save_p, players[i].rings);
WRITEINT16(save_p, players[i].spheres);
for (j = 0; j < NUMPOWERS; j++)
WRITEUINT16(save_p, players[i].powers[j]);
WRITEUINT8(save_p, players[i].playerstate);
WRITEUINT32(save_p, players[i].pflags);
WRITEUINT8(save_p, players[i].panim);
WRITEUINT8(save_p, players[i].spectator);
WRITEUINT32(save_p, players[i].spectatewait);
WRITEUINT16(save_p, players[i].flashpal);
WRITEUINT16(save_p, players[i].flashcount);
@ -149,23 +144,12 @@ static void P_NetArchivePlayers(void)
WRITEINT32(save_p, players[i].skin);
WRITEUINT32(save_p, players[i].availabilities);
WRITEUINT32(save_p, players[i].score);
WRITEFIXED(save_p, players[i].dashspeed);
WRITESINT8(save_p, players[i].lives);
WRITEUINT8(save_p, players[i].lostlife);
WRITESINT8(save_p, players[i].continues);
WRITESINT8(save_p, players[i].xtralife);
WRITEUINT8(save_p, players[i].gotcontinue);
WRITEFIXED(save_p, players[i].speed);
WRITEUINT8(save_p, players[i].secondjump);
WRITEUINT8(save_p, players[i].fly1);
WRITEUINT8(save_p, players[i].scoreadd);
WRITEUINT32(save_p, players[i].glidetime);
WRITEUINT8(save_p, players[i].climbing);
WRITEFIXED(save_p, players[i].lastspeed);
WRITEINT32(save_p, players[i].deadtimer);
WRITEUINT32(save_p, players[i].exiting);
WRITEUINT8(save_p, players[i].homing);
WRITEUINT32(save_p, players[i].dashmode);
WRITEUINT32(save_p, players[i].skidtime);
////////////////////////////
// Conveyor Belt Movement //
@ -175,59 +159,14 @@ static void P_NetArchivePlayers(void)
WRITEFIXED(save_p, players[i].rmomx); // "Real" momx (momx - cmomx)
WRITEFIXED(save_p, players[i].rmomy); // "Real" momy (momy - cmomy)
/////////////////////
// Race Mode Stuff //
/////////////////////
WRITEINT16(save_p, players[i].numboxes);
WRITEINT16(save_p, players[i].totalring);
WRITEUINT32(save_p, players[i].realtime);
WRITEUINT8(save_p, players[i].laps);
WRITEINT32(save_p, players[i].starpostnum);
////////////////////
// CTF Mode Stuff //
////////////////////
WRITEINT32(save_p, players[i].ctfteam);
WRITEUINT16(save_p, players[i].gotflag);
WRITEUINT8(save_p, players[i].ctfteam);
WRITEINT32(save_p, players[i].weapondelay);
WRITEINT32(save_p, players[i].tossdelay);
WRITEANGLE(save_p, players[i].angle_pos);
WRITEANGLE(save_p, players[i].old_angle_pos);
WRITEINT32(save_p, players[i].flyangle);
WRITEUINT32(save_p, players[i].drilltimer);
WRITEINT32(save_p, players[i].linkcount);
WRITEUINT32(save_p, players[i].linktimer);
WRITEINT32(save_p, players[i].anotherflyangle);
WRITEUINT32(save_p, players[i].nightstime);
WRITEUINT32(save_p, players[i].bumpertime);
WRITEINT32(save_p, players[i].drillmeter);
WRITEUINT8(save_p, players[i].drilldelay);
WRITEUINT8(save_p, players[i].bonustime);
WRITEFIXED(save_p, players[i].oldscale);
WRITEUINT8(save_p, players[i].mare);
WRITEUINT8(save_p, players[i].marelap);
WRITEUINT8(save_p, players[i].marebonuslap);
WRITEUINT32(save_p, players[i].marebegunat);
WRITEUINT32(save_p, players[i].startedtime);
WRITEUINT32(save_p, players[i].finishedtime);
WRITEUINT32(save_p, players[i].lapbegunat);
WRITEUINT32(save_p, players[i].lapstartedtime);
WRITEINT16(save_p, players[i].finishedspheres);
WRITEINT16(save_p, players[i].finishedrings);
WRITEUINT32(save_p, players[i].marescore);
WRITEUINT32(save_p, players[i].lastmarescore);
WRITEUINT32(save_p, players[i].totalmarescore);
WRITEUINT8(save_p, players[i].lastmare);
WRITEUINT8(save_p, players[i].lastmarelap);
WRITEUINT8(save_p, players[i].lastmarebonuslap);
WRITEUINT8(save_p, players[i].totalmarelap);
WRITEUINT8(save_p, players[i].totalmarebonuslap);
WRITEINT32(save_p, players[i].maxlink);
WRITEUINT8(save_p, players[i].texttimer);
WRITEUINT8(save_p, players[i].textvar);
WRITEUINT8(save_p, players[i].checkskip);
if (players[i].awayviewmobj)
flags |= AWAYVIEW;
@ -241,10 +180,6 @@ static void P_NetArchivePlayers(void)
WRITEINT16(save_p, players[i].lastsidehit);
WRITEINT16(save_p, players[i].lastlinehit);
WRITEUINT32(save_p, players[i].losstime);
WRITEUINT8(save_p, players[i].timeshit);
WRITEINT32(save_p, players[i].onconveyor);
WRITEUINT32(save_p, players[i].jointime);
@ -274,30 +209,111 @@ static void P_NetArchivePlayers(void)
if (flags & FOLLOWER)
WRITEUINT32(save_p, players[i].follower->mobjnum);
for (j = 0; j < NUMKARTSTUFF; j++)
WRITEINT32(save_p, players[i].kartstuff[j]);
WRITEUINT16(save_p, players[i].nocontrol);
WRITEUINT8(save_p, players[i].carry);
WRITEUINT16(save_p, players[i].dye);
WRITEUINT8(save_p, players[i].position);
WRITEUINT8(save_p, players[i].oldposition);
WRITEUINT8(save_p, players[i].positiondelay);
WRITEUINT32(save_p, players[i].distancetofinish);
WRITEUINT32(save_p, K_GetWaypointHeapIndex(players[i].nextwaypoint));
WRITEUINT32(save_p, players[i].airtime);
WRITEUINT8(save_p, players[i].driftInput);
WRITEUINT8(save_p, players[i].airFailsafe);
WRITEUINT8(save_p, players[i].startboost);
WRITEUINT16(save_p, players[i].flashing);
WRITEUINT16(save_p, players[i].spinouttimer);
WRITEUINT8(save_p, players[i].spinouttype);
WRITEUINT8(save_p, players[i].instashield);
WRITEUINT8(save_p, players[i].wipeoutslow);
WRITEUINT8(save_p, players[i].justbumped);
WRITEUINT8(save_p, players[i].tumbleBounces);
WRITEUINT16(save_p, players[i].tumbleHeight);
WRITESINT8(save_p, players[i].drift);
WRITEFIXED(save_p, players[i].driftcharge);
WRITEUINT8(save_p, players[i].driftboost);
WRITEUINT8(save_p, players[i].strongdriftboost);
WRITESINT8(save_p, players[i].aizdriftstrat);
WRITEINT32(save_p, players[i].aizdrifttilt);
WRITEINT32(save_p, players[i].aizdriftturn);
WRITEFIXED(save_p, players[i].offroad);
WRITEUINT8(save_p, players[i].waterskip);
WRITEUINT16(save_p, players[i].tiregrease);
WRITEUINT16(save_p, players[i].springstars);
WRITEUINT16(save_p, players[i].springcolor);
WRITEUINT8(save_p, players[i].dashpadcooldown);
WRITEUINT16(save_p, players[i].spindash);
WRITEFIXED(save_p, players[i].spindashspeed);
WRITEUINT8(save_p, players[i].spindashboost);
WRITEUINT8(save_p, players[i].numboosts);
WRITEFIXED(save_p, players[i].boostpower);
WRITEFIXED(save_p, players[i].speedboost);
WRITEFIXED(save_p, players[i].accelboost);
WRITEFIXED(save_p, players[i].handleboost);
WRITEANGLE(save_p, players[i].boostangle);
WRITEFIXED(save_p, players[i].draftpower);
WRITEUINT16(save_p, players[i].draftleeway);
WRITESINT8(save_p, players[i].lastdraft);
WRITEUINT16(save_p, players[i].itemroulette);
WRITEUINT8(save_p, players[i].roulettetype);
WRITESINT8(save_p, players[i].itemtype);
WRITEUINT8(save_p, players[i].itemamount);
WRITESINT8(save_p, players[i].throwdir);
WRITEUINT8(save_p, players[i].sadtimer);
WRITESINT8(save_p, players[i].rings);
WRITEUINT8(save_p, players[i].pickuprings);
WRITEUINT8(save_p, players[i].ringdelay);
WRITEUINT16(save_p, players[i].ringboost);
WRITEUINT8(save_p, players[i].sparkleanim);
WRITEUINT8(save_p, players[i].superring);
WRITEUINT8(save_p, players[i].curshield);
WRITEUINT8(save_p, players[i].bubblecool);
WRITEUINT8(save_p, players[i].bubbleblowup);
WRITEUINT16(save_p, players[i].flamedash);
WRITEUINT16(save_p, players[i].flamemeter);
WRITEUINT8(save_p, players[i].flamelength);
WRITEUINT16(save_p, players[i].hyudorotimer);
WRITESINT8(save_p, players[i].stealingtimer);
WRITEUINT16(save_p, players[i].sneakertimer);
WRITEUINT8(save_p, players[i].numsneakers);
WRITEUINT8(save_p, players[i].floorboost);
WRITEINT16(save_p, players[i].growshrinktimer);
WRITEUINT16(save_p, players[i].rocketsneakertimer);
WRITEUINT16(save_p, players[i].invincibilitytimer);
WRITEUINT8(save_p, players[i].eggmanexplode);
WRITESINT8(save_p, players[i].eggmanblame);
WRITEUINT8(save_p, players[i].bananadrag);
WRITESINT8(save_p, players[i].lastjawztarget);
WRITEUINT8(save_p, players[i].jawztargetdelay);
WRITEUINT8(save_p, players[i].trickpanel);
WRITEUINT8(save_p, players[i].trickdelay);
WRITEUINT32(save_p, players[i].trickmomx);
WRITEUINT32(save_p, players[i].trickmomy);
WRITEUINT32(save_p, players[i].trickmomz);
WRITEUINT32(save_p, players[i].roundscore);
WRITEUINT8(save_p, players[i].emeralds);
WRITEUINT8(save_p, players[i].bumpers);
WRITEINT16(save_p, players[i].karmadelay);
WRITEUINT8(save_p, players[i].eliminated);
WRITEUINT8(save_p, players[i].tumbleBounces);
WRITEUINT16(save_p, players[i].tumbleHeight);
WRITEUINT8(save_p, players[i].tumbleLastBounce);
WRITEUINT8(save_p, players[i].tumbleSound);
WRITEINT16(save_p, players[i].spheres);
WRITESINT8(save_p, players[i].glanceDir);
@ -324,6 +340,7 @@ static void P_NetArchivePlayers(void)
WRITEUINT32(save_p, players[i].botvars.itemdelay);
WRITEUINT32(save_p, players[i].botvars.itemconfirm);
WRITESINT8(save_p, players[i].botvars.turnconfirm);
WRITEUINT32(save_p, players[i].botvars.spindashconfirm);
}
}
@ -370,18 +387,15 @@ static void P_NetUnArchivePlayers(void)
players[i].aiming = READANGLE(save_p);
players[i].drawangle = READANGLE(save_p);
players[i].viewrollangle = READANGLE(save_p);
players[i].tilt = READANGLE(save_p);
players[i].awayviewaiming = READANGLE(save_p);
players[i].awayviewtics = READINT32(save_p);
players[i].rings = READINT16(save_p);
players[i].spheres = READINT16(save_p);
for (j = 0; j < NUMPOWERS; j++)
players[i].powers[j] = READUINT16(save_p);
players[i].playerstate = READUINT8(save_p);
players[i].pflags = READUINT32(save_p);
players[i].panim = READUINT8(save_p);
players[i].spectator = READUINT8(save_p);
players[i].spectatewait = READUINT32(save_p);
players[i].flashpal = READUINT16(save_p);
players[i].flashcount = READUINT16(save_p);
@ -390,23 +404,12 @@ static void P_NetUnArchivePlayers(void)
players[i].skin = READINT32(save_p);
players[i].availabilities = READUINT32(save_p);
players[i].score = READUINT32(save_p);
players[i].dashspeed = READFIXED(save_p); // dashing speed
players[i].lives = READSINT8(save_p);
players[i].lostlife = (boolean)READUINT8(save_p);
players[i].continues = READSINT8(save_p); // continues that player has acquired
players[i].xtralife = READSINT8(save_p); // Ring Extra Life counter
players[i].gotcontinue = READUINT8(save_p); // got continue from stage
players[i].speed = READFIXED(save_p); // Player's speed (distance formula of MOMX and MOMY values)
players[i].secondjump = READUINT8(save_p);
players[i].fly1 = READUINT8(save_p); // Tails flying
players[i].scoreadd = READUINT8(save_p); // Used for multiple enemy attack bonus
players[i].glidetime = READUINT32(save_p); // Glide counter for thrust
players[i].climbing = READUINT8(save_p); // Climbing on the wall
players[i].lastspeed = READFIXED(save_p);
players[i].deadtimer = READINT32(save_p); // End game if game over lasts too long
players[i].exiting = READUINT32(save_p); // Exitlevel timer
players[i].homing = READUINT8(save_p); // Are you homing?
players[i].dashmode = READUINT32(save_p); // counter for dashmode ability
players[i].skidtime = READUINT32(save_p); // Skid timer
////////////////////////////
// Conveyor Belt Movement //
@ -416,67 +419,18 @@ static void P_NetUnArchivePlayers(void)
players[i].rmomx = READFIXED(save_p); // "Real" momx (momx - cmomx)
players[i].rmomy = READFIXED(save_p); // "Real" momy (momy - cmomy)
/////////////////////
// Race Mode Stuff //
/////////////////////
players[i].numboxes = READINT16(save_p); // Number of item boxes obtained for Race Mode
players[i].totalring = READINT16(save_p); // Total number of rings obtained for Race Mode
players[i].totalring = READINT16(save_p); // Total number of rings obtained for GP
players[i].realtime = READUINT32(save_p); // integer replacement for leveltime
players[i].laps = READUINT8(save_p); // Number of laps (optional)
players[i].starpostnum = READINT32(save_p);
////////////////////
// CTF Mode Stuff //
////////////////////
players[i].ctfteam = READINT32(save_p); // 1 == Red, 2 == Blue
players[i].gotflag = READUINT16(save_p); // 1 == Red, 2 == Blue Do you have the flag?
players[i].ctfteam = READUINT8(save_p); // 1 == Red, 2 == Blue
players[i].weapondelay = READINT32(save_p);
players[i].tossdelay = READINT32(save_p);
players[i].angle_pos = READANGLE(save_p);
players[i].old_angle_pos = READANGLE(save_p);
players[i].flyangle = READINT32(save_p);
players[i].drilltimer = READUINT32(save_p);
players[i].linkcount = READINT32(save_p);
players[i].linktimer = READUINT32(save_p);
players[i].anotherflyangle = READINT32(save_p);
players[i].nightstime = READUINT32(save_p);
players[i].bumpertime = READUINT32(save_p);
players[i].drillmeter = READINT32(save_p);
players[i].drilldelay = READUINT8(save_p);
players[i].bonustime = (boolean)READUINT8(save_p);
players[i].oldscale = READFIXED(save_p);
players[i].mare = READUINT8(save_p);
players[i].marelap = READUINT8(save_p);
players[i].marebonuslap = READUINT8(save_p);
players[i].marebegunat = READUINT32(save_p);
players[i].startedtime = READUINT32(save_p);
players[i].finishedtime = READUINT32(save_p);
players[i].lapbegunat = READUINT32(save_p);
players[i].lapstartedtime = READUINT32(save_p);
players[i].finishedspheres = READINT16(save_p);
players[i].finishedrings = READINT16(save_p);
players[i].marescore = READUINT32(save_p);
players[i].lastmarescore = READUINT32(save_p);
players[i].totalmarescore = READUINT32(save_p);
players[i].lastmare = READUINT8(save_p);
players[i].lastmarelap = READUINT8(save_p);
players[i].lastmarebonuslap = READUINT8(save_p);
players[i].totalmarelap = READUINT8(save_p);
players[i].totalmarebonuslap = READUINT8(save_p);
players[i].maxlink = READINT32(save_p);
players[i].texttimer = READUINT8(save_p);
players[i].textvar = READUINT8(save_p);
players[i].checkskip = READUINT8(save_p);
players[i].lastsidehit = READINT16(save_p);
players[i].lastlinehit = READINT16(save_p);
players[i].losstime = READUINT32(save_p);
players[i].timeshit = READUINT8(save_p);
players[i].onconveyor = READINT32(save_p);
players[i].jointime = READUINT32(save_p);
@ -507,30 +461,111 @@ static void P_NetUnArchivePlayers(void)
if (flags & FOLLOWER)
players[i].follower = (mobj_t *)(size_t)READUINT32(save_p);
for (j = 0; j < NUMKARTSTUFF; j++)
players[i].kartstuff[j] = READINT32(save_p);
players[i].nocontrol = READUINT16(save_p);
players[i].carry = READUINT8(save_p);
players[i].dye = READUINT16(save_p);
players[i].position = READUINT8(save_p);
players[i].oldposition = READUINT8(save_p);
players[i].positiondelay = READUINT8(save_p);
players[i].distancetofinish = READUINT32(save_p);
players[i].nextwaypoint = (waypoint_t *)(size_t)READUINT32(save_p);
players[i].airtime = READUINT32(save_p);
players[i].driftInput = (boolean)READUINT8(save_p);
players[i].airFailsafe = (boolean)READUINT8(save_p);
players[i].startboost = READUINT8(save_p);
players[i].flashing = READUINT16(save_p);
players[i].spinouttimer = READUINT16(save_p);
players[i].spinouttype = READUINT8(save_p);
players[i].instashield = READUINT8(save_p);
players[i].wipeoutslow = READUINT8(save_p);
players[i].justbumped = READUINT8(save_p);
players[i].tumbleBounces = READUINT8(save_p);
players[i].tumbleHeight = READUINT16(save_p);
players[i].drift = READSINT8(save_p);
players[i].driftcharge = READFIXED(save_p);
players[i].driftboost = READUINT8(save_p);
players[i].strongdriftboost = READUINT8(save_p);
players[i].aizdriftstrat = READSINT8(save_p);
players[i].aizdrifttilt = READINT32(save_p);
players[i].aizdriftturn = READINT32(save_p);
players[i].offroad = READFIXED(save_p);
players[i].waterskip = READUINT8(save_p);
players[i].tiregrease = READUINT16(save_p);
players[i].springstars = READUINT16(save_p);
players[i].springcolor = READUINT16(save_p);
players[i].dashpadcooldown = READUINT8(save_p);
players[i].spindash = READUINT16(save_p);
players[i].spindashspeed = READFIXED(save_p);
players[i].spindashboost = READUINT8(save_p);
players[i].numboosts = READUINT8(save_p);
players[i].boostpower = READFIXED(save_p);
players[i].speedboost = READFIXED(save_p);
players[i].accelboost = READFIXED(save_p);
players[i].handleboost = READFIXED(save_p);
players[i].boostangle = READANGLE(save_p);
players[i].draftpower = READFIXED(save_p);
players[i].draftleeway = READUINT16(save_p);
players[i].lastdraft = READSINT8(save_p);
players[i].itemroulette = READUINT16(save_p);
players[i].roulettetype = READUINT8(save_p);
players[i].itemtype = READSINT8(save_p);
players[i].itemamount = READUINT8(save_p);
players[i].throwdir = READSINT8(save_p);
players[i].sadtimer = READUINT8(save_p);
players[i].rings = READSINT8(save_p);
players[i].pickuprings = READUINT8(save_p);
players[i].ringdelay = READUINT8(save_p);
players[i].ringboost = READUINT16(save_p);
players[i].sparkleanim = READUINT8(save_p);
players[i].superring = READUINT8(save_p);
players[i].curshield = READUINT8(save_p);
players[i].bubblecool = READUINT8(save_p);
players[i].bubbleblowup = READUINT8(save_p);
players[i].flamedash = READUINT16(save_p);
players[i].flamemeter = READUINT16(save_p);
players[i].flamelength = READUINT8(save_p);
players[i].hyudorotimer = READUINT16(save_p);
players[i].stealingtimer = READSINT8(save_p);
players[i].sneakertimer = READUINT16(save_p);
players[i].numsneakers = READUINT8(save_p);
players[i].floorboost = READUINT8(save_p);
players[i].growshrinktimer = READINT16(save_p);
players[i].rocketsneakertimer = READUINT16(save_p);
players[i].invincibilitytimer = READUINT16(save_p);
players[i].eggmanexplode = READUINT8(save_p);
players[i].eggmanblame = READSINT8(save_p);
players[i].bananadrag = READUINT8(save_p);
players[i].lastjawztarget = READSINT8(save_p);
players[i].jawztargetdelay = READUINT8(save_p);
players[i].trickpanel = READUINT8(save_p);
players[i].trickdelay = READUINT8(save_p);
players[i].trickmomx = READUINT32(save_p);
players[i].trickmomy = READUINT32(save_p);
players[i].trickmomz = READUINT32(save_p);
players[i].roundscore = READUINT32(save_p);
players[i].emeralds = READUINT8(save_p);
players[i].bumpers = READUINT8(save_p);
players[i].karmadelay = READINT16(save_p);
players[i].eliminated = (boolean)READUINT8(save_p);
players[i].tumbleBounces = READUINT8(save_p);
players[i].tumbleHeight = READUINT16(save_p);
players[i].tumbleLastBounce = (boolean)READUINT8(save_p);
players[i].tumbleSound = (boolean)READUINT8(save_p);
players[i].spheres = READINT16(save_p);
players[i].glanceDir = READSINT8(save_p);
@ -557,6 +592,7 @@ static void P_NetUnArchivePlayers(void)
players[i].botvars.itemdelay = READUINT32(save_p);
players[i].botvars.itemconfirm = READUINT32(save_p);
players[i].botvars.turnconfirm = READSINT8(save_p);
players[i].botvars.spindashconfirm = READUINT32(save_p);
//players[i].viewheight = P_GetPlayerViewHeight(players[i]); // scale cannot be factored in at this point
}

View file

@ -33,7 +33,6 @@ typedef struct
UINT8 skin;
INT32 score;
INT32 lives;
INT32 continues;
UINT16 emeralds;
UINT8 numgameovers;
} savedata_t;

View file

@ -758,7 +758,7 @@ void P_ReloadRings(void)
else if (mt->type >= 600 && mt->type <= 609) // Item patterns
{
mt->mobj = NULL;
P_SpawnItemPattern(mt, true);
P_SpawnItemPattern(mt);
}
}
for (i = 0; i < numHoops; i++)
@ -867,7 +867,7 @@ static void P_SpawnMapThings(boolean spawnemblems)
mt->mobj = NULL;
if (mt->type >= 600 && mt->type <= 609) // item patterns
P_SpawnItemPattern(mt, false);
P_SpawnItemPattern(mt);
else if (mt->type == 1705 || mt->type == 1713) // hoops
P_SpawnHoop(mt);
else // Everything else
@ -1277,7 +1277,6 @@ static void P_LoadSidedefs(UINT8 *data)
case 335: // Trigger linedef executor: Object dye - Each time
case 336: // Trigger linedef executor: Object dye - Once
case 425: // Calls P_SetMobjState on calling mobj
case 434: // Custom Power
case 442: // Calls P_SetMobjState on mobjs of a given type in the tagged sectors
case 461: // Spawns an object on the map based on texture offsets
case 463: // Colorizes an object
@ -3449,42 +3448,13 @@ static void P_InitLevelSettings(void)
p++;
if (grandprixinfo.gp == false)
{
players[i].lives = 3;
players[i].xtralife = 0;
players[i].totalring = 0;
}
players[i].realtime = racecountdown = exitcountdown = 0;
curlap = bestlap = 0; // SRB2Kart
players[i].lostlife = false;
players[i].gotcontinue = false;
players[i].deadtimer = players[i].numboxes = players[i].laps = 0;
players[i].aiming = 0;
players[i].pflags &= ~PF_GAMETYPEOVER;
G_PlayerReborn(i, true);
}
racecountdown = exitcountdown = exitfadestarted = 0;
for (i = 0; i < MAXPLAYERS; i++)
{
G_PlayerReborn(i, true);
// obliteration station...
players[i].numboxes = players[i].totalring =\
players[i].laps = players[i].marescore = players[i].lastmarescore =\
players[i].mare = players[i].exiting = 0;
players[i].drillmeter = 40*20;
// hit these too
players[i].pflags &= ~(PF_GAMETYPEOVER);
// Wipe follower from existence to avoid crashes
players[i].follower = NULL;
}
curlap = bestlap = 0; // SRB2Kart
// SRB2Kart: map load variables
if (grandprixinfo.gp == true)
@ -4044,7 +4014,6 @@ boolean P_LoadLevel(boolean fromnetsave, boolean reloadinggamestate)
if (!fromnetsave && savedata.lives > 0)
{
numgameovers = savedata.numgameovers;
players[consoleplayer].continues = savedata.continues;
players[consoleplayer].lives = savedata.lives;
players[consoleplayer].score = savedata.score;
emeralds = savedata.emeralds;

View file

@ -116,7 +116,6 @@ void P_DeleteFlickies(INT16 i);
// Needed for NiGHTS
void P_ReloadRings(void);
void P_SwitchSpheresBonusMode(boolean bonustime);
void P_DeleteGrades(INT16 i);
void P_AddGradesForMare(INT16 i, UINT8 mare, char *gtext);
UINT8 P_GetGrade(UINT32 pscore, INT16 map, UINT8 mare);

View file

@ -851,7 +851,6 @@ void P_SlopeLaunch(mobj_t *mo)
if (mo->player)
{
mo->player->powers[pw_justlaunched] = 1;
mo->player->stairjank = 0; // fuck you
}
}
@ -898,9 +897,7 @@ void P_HandleSlopeLanding(mobj_t *thing, pslope_t *slope)
{
thing->standingslope = slope;
P_SetPitchRollFromSlope(thing, slope);
if (!thing->player || !(thing->player->pflags & PF_BOUNCING))
thing->momz = -P_MobjFlip(thing);
thing->momz = -P_MobjFlip(thing);
}
return;
}
@ -916,8 +913,7 @@ void P_HandleSlopeLanding(mobj_t *thing, pslope_t *slope)
thing->momy = mom.y;
thing->standingslope = slope;
P_SetPitchRollFromSlope(thing, slope);
if (!thing->player || !(thing->player->pflags & PF_BOUNCING))
thing->momz = -P_MobjFlip(thing);
thing->momz = -P_MobjFlip(thing);
}
}

View file

@ -1552,7 +1552,7 @@ boolean P_RunTriggerLinedef(line_t *triggerline, mobj_t *actor, sector_t *caller
case 336: // object dye - once
{
INT32 triggercolor = (INT32)sides[triggerline->sidenum[0]].toptexture;
UINT16 color = (actor->player ? actor->player->powers[pw_dye] : actor->color);
UINT16 color = (actor->player ? actor->player->dye : actor->color);
boolean invert = (triggerline->flags & ML_NOCLIMB ? true : false);
if (invert ^ (triggercolor != color))
@ -1872,7 +1872,7 @@ static void K_HandleLapIncrement(player_t *player)
player->karthud[khud_laphand] = 3;
else
{
if (nump > 2 && player->kartstuff[k_position] == 1) // 1st place in 1v1 uses thumbs up
if (nump > 2 && player->position == 1) // 1st place in 1v1 uses thumbs up
player->karthud[khud_laphand] = 1;
else
player->karthud[khud_laphand] = 2;
@ -1895,8 +1895,11 @@ static void K_HandleLapIncrement(player_t *player)
if (rainbowstartavailable == true)
{
S_StartSound(player->mo, sfx_s23c);
player->kartstuff[k_startboost] = 125;
K_SpawnDriftBoostExplosion(player, 3);
player->startboost = 125;
K_SpawnDriftBoostExplosion(player, 4);
K_SpawnDriftElectricSparks(player);
rainbowstartavailable = false;
}
@ -1920,7 +1923,7 @@ static void K_HandleLapIncrement(player_t *player)
}
else
{
if ((player->laps > (UINT8)(cv_numlaps.value)) && (player->kartstuff[k_position] == 1))
if ((player->laps > (UINT8)(cv_numlaps.value)) && (player->position == 1))
{
// opponent finished
S_StartSound(NULL, sfx_s253);
@ -2011,7 +2014,7 @@ static void K_HandleLapDecrement(player_t *player)
void P_CrossSpecialLine(line_t *line, INT32 side, mobj_t *thing)
{
// only used for the players currently
if (!(thing && thing->player && !thing->player->spectator && !(thing->player->pflags & PF_GAMETYPEOVER)))
if (!(thing && thing->player && !thing->player->spectator && !(thing->player->pflags & PF_NOCONTEST)))
return;
{
player_t *player = thing->player;
@ -2779,27 +2782,6 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
mo->flags2 |= MF2_OBJECTFLIP;
break;
case 434: // Custom Power
if (mo && mo->player)
{
mobj_t *dummy = P_SpawnMobj(mo->x, mo->y, mo->z, MT_NULL);
var1 = sides[line->sidenum[0]].toptexture; //(line->dx>>FRACBITS)-1;
if (line->sidenum[1] != 0xffff && line->flags & ML_BLOCKPLAYERS) // read power from back sidedef
var2 = sides[line->sidenum[1]].toptexture;
else if (line->flags & ML_NOCLIMB) // 'Infinite'
var2 = UINT16_MAX;
else
var2 = sides[line->sidenum[0]].textureoffset>>FRACBITS;
P_SetTarget(&dummy->target, mo);
A_CustomPower(dummy);
P_RemoveMobj(dummy);
}
break;
case 435: // Change scroller direction
{
scroll_t *scroller;
@ -2865,7 +2847,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
fractime = 1; //instantly wears off upon leaving
if (line->flags & ML_NOCLIMB)
fractime |= 1<<15; //more crazy &ing, as if music stuff wasn't enough
mo->player->powers[pw_nocontrol] = fractime;
mo->player->nocontrol = fractime;
}
break;
@ -3896,7 +3878,7 @@ void P_SetupSignExit(player_t *player)
thinker_t *think;
INT32 numfound = 0;
if (player->kartstuff[k_position] != 1)
if (player->position != 1)
return;
for (; node; node = node->m_thinglist_next)
@ -4538,7 +4520,7 @@ DoneSection2:
}
player->trickpanel = 1;
player->trickdelay = 1;
player->pflags |= PF_TRICKDELAY;
K_DoPogoSpring(player->mo, upwards, 1);
// Reduce speed
@ -4560,9 +4542,9 @@ DoneSection2:
break;
case 5: // Speed pad
if (player->kartstuff[k_floorboost] != 0)
if (player->floorboost != 0)
{
player->kartstuff[k_floorboost] = 2;
player->floorboost = 2;
break;
}
@ -4594,9 +4576,9 @@ DoneSection2:
P_InstaThrust(player->mo, lineangle, max(linespeed, 2*playerspeed));
player->kartstuff[k_dashpadcooldown] = TICRATE/3;
player->dashpadcooldown = TICRATE/3;
player->trickpanel = 0;
player->kartstuff[k_floorboost] = 2;
player->floorboost = 2;
S_StartSound(player->mo, sfx_cdfm62);
}
break;
@ -4669,10 +4651,10 @@ DoneSection2:
case 6: // SRB2kart 190117 - Sneaker Panel
if (roversector || P_MobjReadyToTrigger(player->mo, sector))
{
if (!player->kartstuff[k_floorboost])
player->kartstuff[k_floorboost] = 3;
if (!player->floorboost)
player->floorboost = 3;
else
player->kartstuff[k_floorboost] = 2;
player->floorboost = 2;
K_DoSneaker(player, 0);
}
break;
@ -4688,10 +4670,7 @@ DoneSection2:
mobj_t *waypoint = NULL;
angle_t an;
if (player->mo->tracer && player->mo->tracer->type == MT_TUBEWAYPOINT && player->powers[pw_carry] == CR_ZOOMTUBE)
break;
if (player->powers[pw_ignorelatch] & (1<<15))
if (player->mo->tracer && player->mo->tracer->type == MT_TUBEWAYPOINT && player->carry == CR_ZOOMTUBE)
break;
// Find line #3 tagged to this sector
@ -4731,10 +4710,8 @@ DoneSection2:
break; // behind back
P_SetTarget(&player->mo->tracer, waypoint);
player->powers[pw_carry] = CR_ZOOMTUBE;
player->carry = CR_ZOOMTUBE;
player->speed = speed;
player->pflags &= ~(PF_SLIDING);
}
break;
@ -4746,7 +4723,7 @@ DoneSection2:
mobj_t *waypoint = NULL;
angle_t an;
if (player->mo->tracer && player->mo->tracer->type == MT_TUBEWAYPOINT && player->powers[pw_carry] == CR_ZOOMTUBE)
if (player->mo->tracer && player->mo->tracer->type == MT_TUBEWAYPOINT && player->carry == CR_ZOOMTUBE)
break;
// Find line #11 tagged to this sector
@ -4786,7 +4763,7 @@ DoneSection2:
break; // behind back
P_SetTarget(&player->mo->tracer, waypoint);
player->powers[pw_carry] = CR_ZOOMTUBE;
player->carry = CR_ZOOMTUBE;
player->speed = speed;
}
break;
@ -8527,8 +8504,8 @@ void T_Pusher(pusher_t *p)
continue;
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)))
&& (thing->player->flashing > (K_GetKartFlashing(thing->player)/4)*3
&& thing->player->flashing <= K_GetKartFlashing(thing->player)))
continue;
inFOF = touching = moved = false;
@ -8656,11 +8633,11 @@ void T_Pusher(pusher_t *p)
if (moved)
{
if (p->slider && thing->player)
if (p->slider && thing->player && !thing->player->carry)
{
P_ResetPlayer (thing->player);
thing->player->pflags |= PF_SLIDING;
thing->player->carry = CR_SLIDING;
thing->angle = R_PointToAngle2 (0, 0, xspeed<<(FRACBITS-PUSH_FACTOR), yspeed<<(FRACBITS-PUSH_FACTOR));
if (!demo.playback)

View file

@ -360,7 +360,7 @@ static void P_DoAutobalanceTeams(void)
INT32 i=0;
INT32 red=0, blue=0;
INT32 redarray[MAXPLAYERS], bluearray[MAXPLAYERS];
INT32 redflagcarrier = 0, blueflagcarrier = 0;
//INT32 redflagcarrier = 0, blueflagcarrier = 0;
INT32 totalred = 0, totalblue = 0;
NetPacket.value.l = NetPacket.value.b = 0;
@ -380,29 +380,29 @@ static void P_DoAutobalanceTeams(void)
{
if (players[i].ctfteam == 1)
{
if (!players[i].gotflag)
//if (!players[i].gotflag)
{
redarray[red] = i; //store the player's node.
red++;
}
else
redflagcarrier++;
/*else
redflagcarrier++;*/
}
else
{
if (!players[i].gotflag)
//if (!players[i].gotflag)
{
bluearray[blue] = i; //store the player's node.
blue++;
}
else
blueflagcarrier++;
/*else
blueflagcarrier++;*/
}
}
}
totalred = red + redflagcarrier;
totalblue = blue + blueflagcarrier;
totalred = red;// + redflagcarrier;
totalblue = blue;// + blueflagcarrier;
if ((abs(totalred - totalblue) > max(1, (totalred + totalblue) / 8)))
{
@ -614,7 +614,6 @@ void P_Ticker(boolean run)
}
// Run shield positioning
P_RunShields();
P_RunOverlays();
P_UpdateSpecials();
@ -777,7 +776,6 @@ void P_PreTicker(INT32 frames)
LUAh_ThinkFrame();
// Run shield positioning
P_RunShields();
P_RunOverlays();
P_UpdateSpecials();

View file

@ -338,7 +338,7 @@ void P_GiveEmerald(boolean spawnObj)
P_SetMobjState(emmo, mobjinfo[MT_GOTEMERALD].meleestate + em);
// Make sure we're not being carried before our tracer is changed
players[i].powers[pw_carry] = CR_NONE;
players[i].carry = CR_NONE;
P_SetTarget(&players[i].mo->tracer, emmo);
@ -386,19 +386,6 @@ void P_GiveFinishFlags(player_t *player)
}
}
#if 0
//
// P_ResetScore
//
// This is called when your chain is reset.
void P_ResetScore(player_t *player)
{
// Formally a host for Chaos mode behavior
player->scoreadd = 0;
}
#endif
//
// P_FindLowestLap
//
@ -457,11 +444,11 @@ UINT8 P_FindHighestLap(void)
// P_PlayerInPain
//
// Is player in pain??
// Checks for painstate and pw_flashing, if both found return true
// Checks for painstate and flashing, if both found return true
//
boolean P_PlayerInPain(player_t *player)
{
if (player->kartstuff[k_spinouttimer] || (player->tumbleBounces > 0) || (player->pflags & PF_FAULT))
if (player->spinouttimer || (player->tumbleBounces > 0) || (player->pflags & PF_FAULT))
return true;
return false;
@ -475,10 +462,10 @@ void P_ResetPlayer(player_t *player)
{
//player->pflags &= ~(PF_);
player->powers[pw_carry] = CR_NONE;
player->carry = CR_NONE;
player->onconveyor = 0;
//player->kartstuff[k_drift] = player->kartstuff[k_driftcharge] = 0;
//player->drift = player->driftcharge = 0;
player->trickpanel = 0;
}
@ -531,21 +518,17 @@ void P_GivePlayerLives(player_t *player, INT32 numlives)
// Adds to the player's score
void P_AddPlayerScore(player_t *player, UINT32 amount)
{
//UINT32 oldscore;
if (!((gametyperules & GTR_BUMPERS)))
return;
if (player->exiting) // srb2kart
return;
//oldscore = player->score;
// Don't go above MAXSCORE.
if (player->marescore + amount < MAXSCORE)
player->marescore += amount;
if (player->roundscore + amount < MAXSCORE)
player->roundscore += amount;
else
player->marescore = MAXSCORE;
player->roundscore = MAXSCORE;
}
//
@ -561,8 +544,6 @@ void P_PlayLivesJingle(player_t *player)
else
{
P_PlayJingle(player, JT_1UP);
if (player)
player->powers[pw_extralife] = extralifetics + 1;
strlcpy(S_sfx[sfx_None].caption, "One-up", 7);
S_StartCaption(sfx_None, -1, extralifetics+1);
}
@ -613,38 +594,38 @@ boolean P_EvaluateMusicStatus(UINT16 status, const char *musname)
switch(status)
{
case JT_1UP: // Extra life
result = (players[i].powers[pw_extralife] > 1);
result = false; //(players[i].powers[pw_extralife] > 1);
break;
case JT_SHOES: // Speed shoes
if (players[i].powers[pw_sneakers] > 1 && !players[i].powers[pw_super])
/*if (players[i].powers[pw_sneakers] > 1 && !players[i].powers[pw_super])
{
//strlcpy(S_sfx[sfx_None].caption, "Speed shoes", 12);
//S_StartCaption(sfx_None, -1, players[i].powers[pw_sneakers]);
result = true;
}
else
else*/
result = false;
break;
case JT_INV: // Invincibility
case JT_MINV: // Mario Invincibility
if (players[i].powers[pw_invulnerability] > 1)
/*if (players[i].powers[pw_invulnerability] > 1)
{
//strlcpy(S_sfx[sfx_None].caption, "Invincibility", 14);
//S_StartCaption(sfx_None, -1, players[i].powers[pw_invulnerability]);
result = true;
}
else
else*/
result = false;
break;
case JT_DROWN: // Drowning
result = (players[i].powers[pw_underwater] && players[i].powers[pw_underwater] <= 11*TICRATE + 1);
result = false; //(players[i].powers[pw_underwater] && players[i].powers[pw_underwater] <= 11*TICRATE + 1);
break;
case JT_SUPER: // Super Sonic
result = (players[i].powers[pw_super]);
result = false; //(players[i].powers[pw_super]);
break;
case JT_GOVER: // Game Over
@ -653,7 +634,7 @@ boolean P_EvaluateMusicStatus(UINT16 status, const char *musname)
case JT_NIGHTSTIMEOUT: // NiGHTS Time Out (10 seconds)
case JT_SSTIMEOUT:
result = (players[i].nightstime && players[i].nightstime <= 10*TICRATE);
result = false; //(players[i].nightstime && players[i].nightstime <= 10*TICRATE);
break;
case JT_OTHER: // Other state
@ -675,7 +656,7 @@ boolean P_EvaluateMusicStatus(UINT16 status, const char *musname)
void P_PlayRinglossSound(mobj_t *source)
{
if (source->player && K_GetShieldFromItem(source->player->kartstuff[k_itemtype]) != KSHIELD_NONE)
if (source->player && K_GetShieldFromItem(source->player->itemtype) != KSHIELD_NONE)
S_StartSound(source, sfx_s1a3); // Shield hit (no ring loss)
else if (source->player && source->player->rings <= 0)
S_StartSound(source, sfx_s1a6); // Ring debt (lessened ring loss)
@ -716,19 +697,19 @@ boolean P_EndingMusic(player_t *player)
// Check for if this is valid or not
if (r_splitscreen)
{
if (!((players[displayplayers[0]].exiting || (players[displayplayers[0]].pflags & PF_GAMETYPEOVER))
|| (players[displayplayers[1]].exiting || (players[displayplayers[1]].pflags & PF_GAMETYPEOVER))
|| ((r_splitscreen < 2) && (players[displayplayers[2]].exiting || (players[displayplayers[2]].pflags & PF_GAMETYPEOVER)))
|| ((r_splitscreen < 3) && (players[displayplayers[3]].exiting || (players[displayplayers[3]].pflags & PF_GAMETYPEOVER)))))
if (!((players[displayplayers[0]].exiting || (players[displayplayers[0]].pflags & PF_NOCONTEST))
|| (players[displayplayers[1]].exiting || (players[displayplayers[1]].pflags & PF_NOCONTEST))
|| ((r_splitscreen < 2) && (players[displayplayers[2]].exiting || (players[displayplayers[2]].pflags & PF_NOCONTEST)))
|| ((r_splitscreen < 3) && (players[displayplayers[3]].exiting || (players[displayplayers[3]].pflags & PF_NOCONTEST)))))
return false;
bestlocalplayer = &players[displayplayers[0]];
bestlocalpos = ((players[displayplayers[0]].pflags & PF_GAMETYPEOVER) ? MAXPLAYERS+1 : players[displayplayers[0]].kartstuff[k_position]);
bestlocalpos = ((players[displayplayers[0]].pflags & PF_NOCONTEST) ? MAXPLAYERS+1 : players[displayplayers[0]].position);
#define setbests(p) \
if (((players[p].pflags & PF_GAMETYPEOVER) ? MAXPLAYERS+1 : players[p].kartstuff[k_position]) < bestlocalpos) \
if (((players[p].pflags & PF_NOCONTEST) ? MAXPLAYERS+1 : players[p].position) < bestlocalpos) \
{ \
bestlocalplayer = &players[p]; \
bestlocalpos = ((players[p].pflags & PF_GAMETYPEOVER) ? MAXPLAYERS+1 : players[p].kartstuff[k_position]); \
bestlocalpos = ((players[p].pflags & PF_NOCONTEST) ? MAXPLAYERS+1 : players[p].position); \
}
setbests(displayplayers[1]);
if (r_splitscreen > 1)
@ -739,11 +720,11 @@ boolean P_EndingMusic(player_t *player)
}
else
{
if (!(player->exiting || (player->pflags & PF_GAMETYPEOVER)))
if (!(player->exiting || (player->pflags & PF_NOCONTEST)))
return false;
bestlocalplayer = player;
bestlocalpos = ((player->pflags & PF_GAMETYPEOVER) ? MAXPLAYERS+1 : player->kartstuff[k_position]);
bestlocalpos = ((player->pflags & PF_NOCONTEST) ? MAXPLAYERS+1 : player->position);
}
if ((gametyperules & GTR_CIRCUIT) && bestlocalpos == MAXPLAYERS+1)
@ -814,10 +795,10 @@ void P_RestoreMusic(player_t *player)
#define setbests(p) \
if (players[p].playerstate == PST_LIVE) \
{ \
if (players[p].kartstuff[k_invincibilitytimer] > bestlocaltimer) \
{ wantedmus = 1; bestlocaltimer = players[p].kartstuff[k_invincibilitytimer]; } \
else if (players[p].kartstuff[k_growshrinktimer] > bestlocaltimer) \
{ wantedmus = 2; bestlocaltimer = players[p].kartstuff[k_growshrinktimer]; } \
if (players[p].invincibilitytimer > bestlocaltimer) \
{ wantedmus = 1; bestlocaltimer = players[p].invincibilitytimer; } \
else if (players[p].growshrinktimer > bestlocaltimer) \
{ wantedmus = 2; bestlocaltimer = players[p].growshrinktimer; } \
}
setbests(displayplayers[0]);
setbests(displayplayers[1]);
@ -831,9 +812,9 @@ void P_RestoreMusic(player_t *player)
{
if (player->playerstate == PST_LIVE)
{
if (player->kartstuff[k_invincibilitytimer] > 1)
if (player->invincibilitytimer > 1)
wantedmus = 1;
else if (player->kartstuff[k_growshrinktimer] > 1)
else if (player->growshrinktimer > 1)
wantedmus = 2;
}
}
@ -897,7 +878,7 @@ boolean P_IsObjectInGoop(mobj_t *mo)
//
boolean P_IsObjectOnGround(mobj_t *mo)
{
if (P_IsObjectInGoop(mo) && !(mo->player && mo->player->pflags & PF_BOUNCING))
if (P_IsObjectInGoop(mo))
{
/*
// It's a crazy hack that checking if you're on the ground
@ -1104,170 +1085,6 @@ boolean P_IsDisplayPlayer(player_t *player)
return false;
}
//
// P_SpawnShieldOrb
//
// Spawns the shield orb on the player
// depending on which shield they are
// supposed to have.
//
void P_SpawnShieldOrb(player_t *player)
{
mobjtype_t orbtype;
thinker_t *th;
mobj_t *shieldobj, *ov;
#ifdef PARANOIA
if (!player->mo)
I_Error("P_SpawnShieldOrb: player->mo is NULL!\n");
#endif
// SRB2Kart
// TODO: Make our shields use this system
if (LUAh_ShieldSpawn(player))
return;
if (player->powers[pw_shield] & SH_FORCE)
orbtype = MT_FORCE_ORB;
else switch (player->powers[pw_shield] & SH_NOSTACK)
{
case SH_WHIRLWIND:
orbtype = MT_WHIRLWIND_ORB;
break;
case SH_ATTRACT:
orbtype = MT_ATTRACT_ORB;
break;
case SH_ELEMENTAL:
orbtype = MT_ELEMENTAL_ORB;
break;
case SH_ARMAGEDDON:
orbtype = MT_ARMAGEDDON_ORB;
break;
case SH_PITY:
case SH_PINK: // PITY IN PINK
orbtype = MT_PITY_ORB;
break;
case SH_FLAMEAURA:
orbtype = MT_FLAMEAURA_ORB;
break;
case SH_BUBBLEWRAP:
orbtype = MT_BUBBLEWRAP_ORB;
break;
case SH_THUNDERCOIN:
orbtype = MT_THUNDERCOIN_ORB;
break;
default:
return;
}
// blaze through the thinkers to see if an orb already exists!
for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next)
{
if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed)
continue;
shieldobj = (mobj_t *)th;
if (shieldobj->type == orbtype && shieldobj->target == player->mo)
P_RemoveMobj(shieldobj); //kill the old one(s)
}
shieldobj = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, orbtype);
shieldobj->flags2 |= MF2_SHIELD;
P_SetTarget(&shieldobj->target, player->mo);
if ((player->powers[pw_shield] & SH_NOSTACK) == SH_PINK)
{
shieldobj->color = SKINCOLOR_PINK;
shieldobj->colorized = true;
}
else
shieldobj->color = (UINT16)shieldobj->info->painchance;
shieldobj->threshold = (player->powers[pw_shield] & SH_FORCE) ? SH_FORCE : (player->powers[pw_shield] & SH_NOSTACK);
if (shieldobj->info->seestate)
{
ov = P_SpawnMobj(shieldobj->x, shieldobj->y, shieldobj->z, MT_OVERLAY);
P_SetTarget(&ov->target, shieldobj);
P_SetMobjState(ov, shieldobj->info->seestate);
P_SetTarget(&shieldobj->tracer, ov);
}
if (shieldobj->info->meleestate)
{
ov = P_SpawnMobj(shieldobj->x, shieldobj->y, shieldobj->z, MT_OVERLAY);
P_SetTarget(&ov->target, shieldobj);
P_SetMobjState(ov, shieldobj->info->meleestate);
}
if (shieldobj->info->missilestate)
{
ov = P_SpawnMobj(shieldobj->x, shieldobj->y, shieldobj->z, MT_OVERLAY);
P_SetTarget(&ov->target, shieldobj);
P_SetMobjState(ov, shieldobj->info->missilestate);
}
if (player->powers[pw_shield] & SH_FORCE)
{
//Copy and pasted from P_ShieldLook in p_mobj.c
shieldobj->movecount = (player->powers[pw_shield] & SH_FORCEHP);
if (shieldobj->movecount < 1)
{
if (shieldobj->info->painstate)
P_SetMobjState(shieldobj,shieldobj->info->painstate);
else
shieldobj->renderflags |= RF_GHOSTLY;
}
}
}
//
// P_SwitchShield
//
// Handles the possibility of switching between
// the non-stack layer of shields thoroughly,
// then adds the desired one.
//
void P_SwitchShield(player_t *player, UINT16 shieldtype)
{
boolean donthavealready;
donthavealready = (shieldtype & SH_FORCE)
? (!(player->powers[pw_shield] & SH_FORCE) || (player->powers[pw_shield] & SH_FORCEHP) < (shieldtype & ~SH_FORCE))
: ((player->powers[pw_shield] & SH_NOSTACK) != shieldtype);
if (donthavealready)
{
boolean stopshieldability = (shieldtype & SH_FORCE)
? (!(player->powers[pw_shield] & SH_FORCE))
: true;
// Just in case.
if (stopshieldability && player->pflags & PF_SHIELDABILITY)
{
player->pflags &= ~(PF_SPINNING|PF_SHIELDABILITY); // They'll still have PF_THOKKED...
player->homing = 0;
}
player->powers[pw_shield] = shieldtype|(player->powers[pw_shield] & SH_STACK);
P_SpawnShieldOrb(player);
if (shieldtype & SH_PROTECTWATER)
{
if (player->powers[pw_underwater] && player->powers[pw_underwater] <= 12*TICRATE + 1)
{
player->powers[pw_underwater] = 0;
P_RestoreMusic(player);
}
else
player->powers[pw_underwater] = 0;
if (player->powers[pw_spacetime] > 1)
{
player->powers[pw_spacetime] = 0;
P_RestoreMusic(player);
}
}
}
}
//
// P_SpawnGhostMobj
//
@ -1414,8 +1231,6 @@ void P_DoPlayerExit(player_t *player)
}
}
player->powers[pw_underwater] = 0;
player->powers[pw_spacetime] = 0;
player->karthud[khud_cardanimation] = 0; // srb2kart: reset battle animation
if (player == &players[consoleplayer])
@ -1779,19 +1594,16 @@ static void P_CheckQuicksand(player_t *player)
//
static void P_CheckInvincibilityTimer(player_t *player)
{
if (!player->powers[pw_invulnerability] && !player->kartstuff[k_invincibilitytimer])
if (!player->invincibilitytimer)
return;
player->mo->color = (UINT16)(SKINCOLOR_PINK + (leveltime % (numskincolors - SKINCOLOR_PINK)));
// Resume normal music stuff.
if (player->powers[pw_invulnerability] == 1 || player->kartstuff[k_invincibilitytimer] == 1)
if (player->invincibilitytimer == 1)
{
if (!player->powers[pw_super])
{
player->mo->color = player->skincolor;
G_GhostAddColor((INT32) (player - players), GHC_NORMAL);
}
player->mo->color = player->skincolor;
G_GhostAddColor((INT32) (player - players), GHC_NORMAL);
P_RestoreMusic(player);
}
@ -1809,12 +1621,12 @@ static void P_DoBubbleBreath(player_t *player)
fixed_t z = player->mo->z;
mobj_t *bubble = NULL;
if (!(player->mo->eflags & MFE_UNDERWATER) || (player->powers[pw_shield] & SH_PROTECTWATER) || player->spectator)
if (!(player->mo->eflags & MFE_UNDERWATER) || player->spectator)
return;
if (player->charflags & SF_MACHINE)
{
if (player->powers[pw_underwater] && P_RandomChance((128-(player->powers[pw_underwater]/4))*FRACUNIT/256))
if (P_RandomChance(FRACUNIT/5))
{
fixed_t r = player->mo->radius>>FRACBITS;
x += (P_RandomRange(r, -r)<<FRACBITS);
@ -1866,14 +1678,21 @@ static void P_3dMovement(player_t *player)
oldMagnitude = R_PointToDist2(player->mo->momx - player->cmomx, player->mo->momy - player->cmomy, 0, 0);
if (player->stairjank > 8 && leveltime & 3)
movepushangle = R_PointToAngle2(0, 0,
player->mo->momx, player->mo->momy);
else if (player->kartstuff[k_drift] != 0)
movepushangle = player->mo->angle-(ANGLE_45/5)*player->kartstuff[k_drift];
else if (player->kartstuff[k_spinouttimer] || player->kartstuff[k_wipeoutslow]) // if spun out, use the boost angle
movepushangle = (angle_t)player->kartstuff[k_boostangle];
{
movepushangle = K_MomentumAngle(player->mo);
}
else if (player->drift != 0)
{
movepushangle = player->mo->angle - (ANGLE_45/5) * player->drift;
}
else if (player->spinouttimer || player->wipeoutslow) // if spun out, use the boost angle
{
movepushangle = (angle_t)player->boostangle;
}
else
{
movepushangle = player->mo->angle;
}
// cmomx/cmomy stands for the conveyor belt speed.
if (player->onconveyor == 2) // Wind/Current
@ -1910,7 +1729,7 @@ static void P_3dMovement(player_t *player)
//{ SRB2kart 220217 - Toaster Code for misplaced thrust
#if 0
if (!player->kartstuff[k_drift]) // Not Drifting
if (!player->drift) // Not Drifting
{
angle_t difference = dangle/2;
boolean reverse = (dangle >= ANGLE_90);
@ -2128,7 +1947,7 @@ void P_MovePlayer(player_t *player)
runspd = FixedMul(runspd, player->mo->movefactor);
// Control relinquishing stuff!
if (player->powers[pw_nocontrol])
if (player->nocontrol)
player->pflags |= PF_STASIS;
// note: don't unset stasis here
@ -2162,7 +1981,7 @@ void P_MovePlayer(player_t *player)
UINT8 rollSpeed = max(1, min(8, player->tumbleHeight / 10));
if (player->tumbleLastBounce == true)
if (player->pflags & PF_TUMBLELASTBOUNCE)
spinSpeed = 2;
P_SetPlayerMobjState(player->mo, S_KART_SPINOUT);
@ -2170,7 +1989,7 @@ void P_MovePlayer(player_t *player)
player->mo->rollangle -= (ANGLE_11hh * rollSpeed);
if (player->tumbleLastBounce == true)
if (player->pflags & PF_TUMBLELASTBOUNCE)
{
if (abs((signed)(player->mo->angle - player->drawangle)) < ANGLE_22h)
player->drawangle = player->mo->angle;
@ -2179,15 +1998,15 @@ void P_MovePlayer(player_t *player)
player->mo->rollangle = 0;
}
}
else if (player->pflags & PF_SLIDING)
else if (player->carry == CR_SLIDING)
{
P_SetPlayerMobjState(player->mo, S_KART_SPINOUT);
player->drawangle -= ANGLE_22h;
player->mo->rollangle = 0;
}
else if ((player->pflags & PF_FAULT) || (player->kartstuff[k_spinouttimer] > 0))
else if ((player->pflags & PF_FAULT) || (player->spinouttimer > 0))
{
UINT16 speed = ((player->pflags & PF_FAULT) ? player->powers[pw_nocontrol] : player->kartstuff[k_spinouttimer])/8;
UINT16 speed = ((player->pflags & PF_FAULT) ? player->nocontrol : player->spinouttimer)/8;
if (speed > 8)
speed = 8;
else if (speed < 1)
@ -2206,7 +2025,7 @@ void P_MovePlayer(player_t *player)
{
P_SetPlayerMobjState(player->mo, S_KART_SPINOUT);
if (((player->powers[pw_nocontrol] + 5) % 20) < 10)
if (((player->nocontrol + 5) % 20) < 10)
player->drawangle += ANGLE_11hh;
else
player->drawangle -= ANGLE_11hh;
@ -2229,13 +2048,13 @@ void P_MovePlayer(player_t *player)
{
player->drawangle = player->mo->angle;
if (player->aizDriftTurn)
if (player->aizdriftturn)
{
player->drawangle += player->aizDriftTurn;
player->drawangle += player->aizdriftturn;
}
else if (player->kartstuff[k_drift] != 0)
else if (player->drift != 0)
{
INT32 a = (ANGLE_45 / 5) * player->kartstuff[k_drift];
INT32 a = (ANGLE_45 / 5) * player->drift;
player->drawangle += a;
}
}
@ -2249,13 +2068,13 @@ void P_MovePlayer(player_t *player)
// Drifting sound
// Start looping the sound now.
if (leveltime % 50 == 0 && onground && player->kartstuff[k_drift] != 0)
if (leveltime % 50 == 0 && onground && player->drift != 0)
S_StartSound(player->mo, sfx_drift);
// Leveltime being 50 might take a while at times. We'll start it up once, isntantly.
else if (!S_SoundPlaying(player->mo, sfx_drift) && onground && player->kartstuff[k_drift] != 0)
else if (!S_SoundPlaying(player->mo, sfx_drift) && onground && player->drift != 0)
S_StartSound(player->mo, sfx_drift);
// Ok, we'll stop now.
else if (player->kartstuff[k_drift] == 0)
else if (player->drift == 0)
S_StopSoundByID(player->mo, sfx_drift);
K_MoveKartPlayer(player, onground);
@ -2265,38 +2084,10 @@ void P_MovePlayer(player_t *player)
//GAMEPLAY STUFF//
//////////////////
// If you're running fast enough, you can create splashes as you run in shallow water.
#if 0
if (!player->climbing
&& ((!(player->mo->eflags & MFE_VERTICALFLIP) && player->mo->z + player->mo->height >= player->mo->watertop && player->mo->z <= player->mo->watertop)
if (((!(player->mo->eflags & MFE_VERTICALFLIP) && player->mo->z + player->mo->height >= player->mo->watertop && player->mo->z <= player->mo->watertop)
|| (player->mo->eflags & MFE_VERTICALFLIP && player->mo->z + player->mo->height >= player->mo->waterbottom && player->mo->z <= player->mo->waterbottom))
&& (player->speed > runspd || (player->pflags & PF_STARTDASH))
&& leveltime % (TICRATE/7) == 0 && player->mo->momz == 0 && !(player->pflags & PF_SLIDING) && !player->spectator)
{
mobjtype_t splishtype = (player->mo->eflags & MFE_TOUCHLAVA) ? MT_LAVASPLISH : MT_SPLISH;
mobj_t *water = P_SpawnMobj(player->mo->x - P_ReturnThrustX(NULL, player->mo->angle, player->mo->radius), player->mo->y - P_ReturnThrustY(NULL, player->mo->angle, player->mo->radius),
((player->mo->eflags & MFE_VERTICALFLIP) ? player->mo->waterbottom - FixedMul(mobjinfo[splishtype].height, player->mo->scale) : player->mo->watertop), splishtype);
if (player->mo->eflags & MFE_GOOWATER)
S_StartSound(water, sfx_ghit);
else if (player->mo->eflags & MFE_TOUCHLAVA)
S_StartSound(water, sfx_splash);
else
S_StartSound(water, sfx_wslap);
if (player->mo->eflags & MFE_VERTICALFLIP)
{
water->flags2 |= MF2_OBJECTFLIP;
water->eflags |= MFE_VERTICALFLIP;
}
water->destscale = player->mo->scale;
P_SetScale(water, player->mo->scale);
}
#endif
if (!player->climbing
&& ((!(player->mo->eflags & MFE_VERTICALFLIP) && player->mo->z + player->mo->height >= player->mo->watertop && player->mo->z <= player->mo->watertop)
|| (player->mo->eflags & MFE_VERTICALFLIP && player->mo->z + player->mo->height >= player->mo->waterbottom && player->mo->z <= player->mo->waterbottom))
&& (player->speed > runspd || (player->pflags & PF_STARTDASH))
&& player->mo->momz == 0 && !(player->pflags & PF_SLIDING) && !player->spectator)
&& (player->speed > runspd)
&& player->mo->momz == 0 && player->carry != CR_SLIDING && !player->spectator)
{
fixed_t trailScale = FixedMul(FixedDiv(player->speed - runspd, K_GetKartSpeed(player, false) - runspd), mapobjectscale);
fixed_t playerTopSpeed = K_GetKartSpeed(player, false);
@ -2380,14 +2171,14 @@ void P_MovePlayer(player_t *player)
////////////////////////////
// SRB2kart - Drifting smoke and fire
if ((player->kartstuff[k_sneakertimer] || player->kartstuff[k_flamedash])
if ((player->sneakertimer || player->flamedash)
&& onground && (leveltime & 1))
K_SpawnBoostTrail(player);
if (player->kartstuff[k_invincibilitytimer] > 0)
if (player->invincibilitytimer > 0)
K_SpawnSparkleTrail(player->mo);
if (player->kartstuff[k_wipeoutslow] > 1 && (leveltime & 1))
if (player->wipeoutslow > 1 && (leveltime & 1))
K_SpawnWipeoutTrail(player->mo, false);
K_DriftDustHandling(player->mo);
@ -2440,7 +2231,7 @@ static void P_DoZoomTube(player_t *player)
else
reverse = true;
player->powers[pw_flashing] = 1;
player->flashing = 1;
speed = abs(player->speed);
@ -2498,7 +2289,7 @@ static void P_DoZoomTube(player_t *player)
else
{
P_SetTarget(&player->mo->tracer, NULL); // Else, we just let them fly.
player->powers[pw_carry] = CR_NONE;
player->carry = CR_NONE;
CONS_Debug(DBG_GAMELOGIC, "Next waypoint not found, releasing from track...\n");
}
@ -2648,7 +2439,7 @@ static void P_DeathThink(player_t *player)
if (player->deadtimer < INT32_MAX)
player->deadtimer++;
if ((player->pflags & PF_GAMETYPEOVER) && (gametyperules & GTR_CIRCUIT))
if ((player->pflags & PF_NOCONTEST) && (gametyperules & GTR_CIRCUIT))
{
player->karthud[khud_timeovercam]++;
@ -2663,13 +2454,13 @@ static void P_DeathThink(player_t *player)
K_KartPlayerHUDUpdate(player);
if (player->lives > 0 && !(player->pflags & PF_GAMETYPEOVER) && player->deadtimer > TICRATE)
if (player->lives > 0 && !(player->pflags & PF_NOCONTEST) && player->deadtimer > TICRATE)
{
player->playerstate = PST_REBORN;
}
// Keep time rolling
if (!(exitcountdown && !racecountdown) && !(player->exiting || mapreset) && !(player->pflags & PF_GAMETYPEOVER) && !stoppedclock)
if (!(exitcountdown && !racecountdown) && !(player->exiting || mapreset) && !(player->pflags & PF_NOCONTEST) && !stoppedclock)
{
if (leveltime >= starttime)
{
@ -3097,7 +2888,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|| (leveltime < introtime)); // Kart intro cam
#endif
if ((player->pflags & PF_GAMETYPEOVER) && (gametyperules & GTR_CIRCUIT)) // 1 for momentum keep, 2 for turnaround
if ((player->pflags & PF_NOCONTEST) && (gametyperules & GTR_CIRCUIT)) // 1 for momentum keep, 2 for turnaround
timeover = (player->karthud[khud_timeovercam] > 2*TICRATE ? 2 : 1);
else
timeover = 0;
@ -3291,11 +3082,11 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
pan = xpan = ypan = 0;
else
{
if (player->kartstuff[k_drift] != 0)
if (player->drift != 0)
{
fixed_t panmax = (dist/5);
INT32 driftval = K_GetKartDriftSparkValue(player);
INT32 dc = player->kartstuff[k_driftcharge];
INT32 dc = player->driftcharge;
if (dc > driftval || dc < 0)
dc = driftval;
@ -3304,7 +3095,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
if (pan > panmax)
pan = panmax;
if (player->kartstuff[k_drift] < 0)
if (player->drift < 0)
pan *= -1;
}
else
@ -3639,7 +3430,7 @@ boolean P_SpectatorJoinGame(player_t *player)
{
if (P_IsLocalPlayer(player))
CONS_Printf(M_GetText("Server does not allow team change.\n"));
//player->powers[pw_flashing] = TICRATE + 1; //to prevent message spam.
//player->flashing = TICRATE + 1; //to prevent message spam.
}
// Team changing in Team Match and CTF
// Pressing fire assigns you to a team that needs players if allowed.
@ -3681,7 +3472,7 @@ boolean P_SpectatorJoinGame(player_t *player)
}
player->spectator = false;
player->pflags &= ~PF_WANTSTOJOIN;
player->kartstuff[k_spectatewait] = 0;
player->spectatewait = 0;
player->ctfteam = changeto;
player->playerstate = PST_REBORN;
@ -3711,7 +3502,7 @@ boolean P_SpectatorJoinGame(player_t *player)
}
player->spectator = false;
player->pflags &= ~PF_WANTSTOJOIN;
player->kartstuff[k_spectatewait] = 0;
player->spectatewait = 0;
player->playerstate = PST_REBORN;
//Reset away view
@ -3842,7 +3633,7 @@ static void P_CalcPostImg(player_t *player)
void P_DoTimeOver(player_t *player)
{
if (player->pflags & PF_GAMETYPEOVER)
if (player->pflags & PF_NOCONTEST)
{
// NO! Don't do this!
return;
@ -3858,7 +3649,7 @@ void P_DoTimeOver(player_t *player)
CON_LogMessage(va(M_GetText("%s ran out of time.\n"), player_names[player-players]));
}
player->pflags |= PF_GAMETYPEOVER;
player->pflags |= PF_NOCONTEST;
if (G_GametypeUsesLives())
{
@ -4146,7 +3937,7 @@ static void P_HandleFollower(player_t *player)
player->follower->renderflags = player->mo->renderflags;
// Make the follower invisible if we no contest'd rather than removing it. No one will notice the diff seriously.
if (player->pflags & PF_GAMETYPEOVER)
if (player->pflags & PF_NOCONTEST)
player->follower->renderflags |= RF_DONTDRAW;
if (player->speed && (player->follower->momx || player->follower->momy))
@ -4185,7 +3976,7 @@ static void P_HandleFollower(player_t *player)
// handle follower animations. Could probably be better...
// hurt or dead
if (player->kartstuff[k_spinouttimer] || player->mo->state == &states[S_KART_SPINOUT] || player->mo->health <= 0)
if (player->spinouttimer || player->mo->state == &states[S_KART_SPINOUT] || player->mo->health <= 0)
{
player->follower->movecount = 0; // cancel hit confirm.
player->follower->angle = player->drawangle; // spin out
@ -4397,15 +4188,15 @@ void P_PlayerThink(player_t *player)
// to allow items to be thrown forward or backward.
if (cmd->buttons & BT_FORWARD)
{
player->kartstuff[k_throwdir] = 1;
player->throwdir = 1;
}
else if (cmd->buttons & BT_BACKWARD)
{
player->kartstuff[k_throwdir] = -1;
player->throwdir = -1;
}
else
{
player->kartstuff[k_throwdir] = 0;
player->throwdir = 0;
}
// Accessibility - kickstart your acceleration
@ -4437,7 +4228,7 @@ void P_PlayerThink(player_t *player)
{
if (playeringame[i] && !players[i].spectator)
{
if (!players[i].exiting && !(players[i].pflags & PF_GAMETYPEOVER) && players[i].lives > 0)
if (!players[i].exiting && !(players[i].pflags & PF_NOCONTEST) && players[i].lives > 0)
break;
}
}
@ -4458,7 +4249,7 @@ void P_PlayerThink(player_t *player)
// If you've hit the countdown and you haven't made
// it to the exit, you're a goner!
if (racecountdown == 1 && !player->spectator && !player->exiting && !(player->pflags & PF_GAMETYPEOVER) && player->lives > 0)
if (racecountdown == 1 && !player->spectator && !player->exiting && !(player->pflags & PF_NOCONTEST) && player->lives > 0)
{
P_DoTimeOver(player);
@ -4528,11 +4319,11 @@ void P_PlayerThink(player_t *player)
// SRB2kart 010217
if (leveltime < introtime)
{
player->powers[pw_nocontrol] = 2;
player->nocontrol = 2;
}
// Synchronizes the "real" amount of time spent in the level.
if (!(exitcountdown && !racecountdown) && !(player->exiting || mapreset) && !(player->pflags & PF_GAMETYPEOVER) && !stoppedclock)
if (!(exitcountdown && !racecountdown) && !(player->exiting || mapreset) && !(player->pflags & PF_NOCONTEST) && !stoppedclock)
{
if (leveltime >= starttime)
{
@ -4553,20 +4344,14 @@ void P_PlayerThink(player_t *player)
}
}
if ((netgame || multiplayer) && player->spectator && cmd->buttons & BT_ATTACK && !player->powers[pw_flashing])
if ((netgame || multiplayer) && player->spectator && cmd->buttons & BT_ATTACK && !player->flashing)
{
player->pflags ^= PF_WANTSTOJOIN;
player->powers[pw_flashing] = TICRATE/2 + 1;
player->flashing = TICRATE/2 + 1;
/*if (P_SpectatorJoinGame(player))
return; // player->mo was removed.*/
}
if (player->linktimer && !player->powers[pw_nights_linkfreeze])
{
if (--player->linktimer <= 0) // Link timer
player->linkcount = 0;
}
if (player->respawn.state != RESPAWNST_NONE)
{
K_RespawnChecker(player);
@ -4588,7 +4373,6 @@ void P_PlayerThink(player_t *player)
{
P_DoZoomTube(player);
player->rmomx = player->rmomy = 0;
P_ResetScore(player);
}
else
{
@ -4611,42 +4395,6 @@ void P_PlayerThink(player_t *player)
P_DoBubbleBreath(player); // Spawn Sonic's bubbles
P_CheckInvincibilityTimer(player); // Spawn Invincibility Sparkles
#if 1
// "Blur" a bit when you have speed shoes and are going fast enough
if ((player->powers[pw_super] || player->powers[pw_sneakers])
&& (player->speed + abs(player->mo->momz)) > FixedMul(20*FRACUNIT,player->mo->scale))
{
UINT8 i;
mobj_t *gmobj = P_SpawnGhostMobj(player->mo);
gmobj->fuse = 2;
if (gmobj->tracer)
gmobj->tracer->fuse = 2;
if (leveltime & 1)
{
gmobj->frame &= ~FF_TRANSMASK;
gmobj->frame |= tr_trans70<<FF_TRANSSHIFT;
if (gmobj->tracer)
{
gmobj->tracer->frame &= ~FF_TRANSMASK;
gmobj->tracer->frame |= tr_trans70<<FF_TRANSSHIFT;
}
}
// Hide the mobj from our sights if we're the displayplayer and chasecam is off.
// Why not just not spawn the mobj? Well, I'd rather only flirt with
// consistency so much...
for (i = 0; i <= r_splitscreen; i++)
{
if (player == &players[displayplayers[i]] && !camera[i].chase)
{
gmobj->renderflags |= RF_DONTDRAW;
break;
}
}
}
#endif
// check for buttons
if (cmd->buttons & BT_ACCELERATE)
player->pflags |= PF_ACCELDOWN;
@ -4662,32 +4410,28 @@ void P_PlayerThink(player_t *player)
// Time Bonus & Ring Bonus count settings
// Strength counts up to diminish fade.
if (player->powers[pw_flashing] && player->powers[pw_flashing] < UINT16_MAX &&
if (player->flashing && player->flashing < UINT16_MAX &&
(player->spectator || !P_PlayerInPain(player)))
{
player->powers[pw_flashing]--;
player->flashing--;
}
if (player->powers[pw_nocontrol] && player->powers[pw_nocontrol] < UINT16_MAX)
if (player->nocontrol && player->nocontrol < UINT16_MAX)
{
if (!(--player->powers[pw_nocontrol]))
if (!(--player->nocontrol))
player->pflags &= ~PF_FAULT;
}
else
player->powers[pw_nocontrol] = 0;
//pw_super acts as a timer now
if (player->powers[pw_super])
player->powers[pw_super]++;
player->nocontrol = 0;
// Flash player after being hit.
if (!(player->kartstuff[k_hyudorotimer] // SRB2kart - fixes Hyudoro not flashing when it should.
|| player->kartstuff[k_growshrinktimer] > 0 // Grow doesn't flash either.
if (!(player->hyudorotimer // SRB2kart - fixes Hyudoro not flashing when it should.
|| player->growshrinktimer > 0 // Grow doesn't flash either.
|| (player->respawn.state != RESPAWNST_NONE) // Respawn timer (for drop dash effect)
|| (player->pflags & PF_GAMETYPEOVER) // NO CONTEST explosion
|| (player->pflags & PF_NOCONTEST) // NO CONTEST explosion
|| ((gametyperules & GTR_BUMPERS) && player->bumpers <= 0 && player->karmadelay)))
{
if (player->powers[pw_flashing] > 0 && player->powers[pw_flashing] < K_GetKartFlashing(player)
if (player->flashing > 0 && player->flashing < K_GetKartFlashing(player)
&& (leveltime & 1))
player->mo->renderflags |= RF_DONTDRAW;
else
@ -4757,12 +4501,13 @@ void P_PlayerThink(player_t *player)
player->stairjank--;
}
player->pflags &= ~PF_SLIDING;
K_KartPlayerThink(player, cmd); // SRB2kart
DoABarrelRoll(player);
if (player->carry == CR_SLIDING)
player->carry = CR_NONE;
LUAh_PlayerThink(player);
}
@ -4812,9 +4557,6 @@ void P_PlayerAfterThink(player_t *player)
return;
}
if (player->pflags & PF_SLIDING)
P_SetPlayerMobjState(player->mo, player->mo->info->painstate);
if (thiscam)
{
if (!thiscam->chase) // bob view only if looking through the player's eyes
@ -4847,12 +4589,6 @@ void P_PlayerAfterThink(player_t *player)
K_KartPlayerAfterThink(player);
if (player->powers[pw_dye])
{
player->mo->colorized = true;
player->mo->color = player->powers[pw_dye];
}
if (player->followmobj && (player->spectator || player->mo->health <= 0 || player->followmobj->type != player->followitem))
{
P_RemoveMobj(player->followmobj);
@ -4931,5 +4667,5 @@ void P_ForceLocalAngle(player_t *player, angle_t angle)
boolean P_PlayerFullbright(player_t *player)
{
return (player->kartstuff[k_invincibilitytimer] > 0);
return (player->invincibilitytimer > 0);
}

View file

@ -38,7 +38,7 @@ static angle_t R_PlayerSpriteRotation(player_t *player)
angle_t viewingAngle = R_PointToAngle(player->mo->x, player->mo->y);
angle_t angleDelta = (viewingAngle - player->mo->angle);
angle_t sliptideLift = player->aizDriftTilt;
angle_t sliptideLift = player->aizdrifttilt;
angle_t rollAngle = 0;

View file

@ -909,7 +909,7 @@ static void ST_overlayDrawer(void)
{
const char *itemtxt = M_GetText("Item - Join Game");
if (stplyr->powers[pw_flashing])
if (stplyr->flashing)
itemtxt = M_GetText("Item - . . .");
else if (stplyr->pflags & PF_WANTSTOJOIN)
itemtxt = M_GetText("Item - Cancel Join");

View file

@ -165,7 +165,7 @@ static void Y_UnloadVoteData(void);
//
static void Y_CompareTime(INT32 i)
{
UINT32 val = ((players[i].pflags & PF_GAMETYPEOVER || players[i].realtime == UINT32_MAX)
UINT32 val = ((players[i].pflags & PF_NOCONTEST || players[i].realtime == UINT32_MAX)
? (UINT32_MAX-1) : players[i].realtime);
if (!(val < data.val[data.numplayers]))
@ -177,11 +177,11 @@ static void Y_CompareTime(INT32 i)
static void Y_CompareScore(INT32 i)
{
UINT32 val = ((players[i].pflags & PF_GAMETYPEOVER)
? (UINT32_MAX-1) : players[i].marescore);
UINT32 val = ((players[i].pflags & PF_NOCONTEST)
? (UINT32_MAX-1) : players[i].roundscore);
if (!(data.val[data.numplayers] == UINT32_MAX
|| (!(players[i].pflags & PF_GAMETYPEOVER) && val > data.val[data.numplayers])))
|| (!(players[i].pflags & PF_NOCONTEST) && val > data.val[data.numplayers])))
return;
data.val[data.numplayers] = val;
@ -310,7 +310,7 @@ static void Y_CalculateMatchData(UINT8 rankingsmode, void (*comparison)(INT32))
if ((powertype == PWRLV_DISABLED)
&& (!rankingsmode)
&& !(players[i].pflags & PF_GAMETYPEOVER)
&& !(players[i].pflags & PF_NOCONTEST)
&& (data.pos[data.numplayers] < (numplayersingame + numgriefers)))
{
// Online rank is handled further below in this file.