Seperate out itemflags
This commit is contained in:
parent
d5af3f58ff
commit
a148d4e17b
14 changed files with 115 additions and 93 deletions
|
|
@ -59,6 +59,14 @@ typedef enum
|
|||
PST_REBORN
|
||||
} playerstate_t;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
IF_USERINGS = 1, // Have to be not holding the item button to change from using rings to using items (or vice versa) - prevents weirdness
|
||||
IF_ITEMOUT = 1<<1, // Are you holding an item out?
|
||||
IF_EGGMANOUT = 1<<2, // Eggman mark held, separate from IF_ITEMOUT so it doesn't stop you from getting items
|
||||
IF_HOLDREADY = 1<<3, // Hold button-style item is ready to activate
|
||||
} itemflags_t;
|
||||
|
||||
//
|
||||
// Player internal flags
|
||||
//
|
||||
|
|
@ -85,28 +93,22 @@ typedef enum
|
|||
|
||||
PF_RINGLOCK = 1<<13, // Prevent picking up rings while SPB is locked on
|
||||
|
||||
// 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
|
||||
PF_DRIFTINPUT = 1<<14, // Drifting!
|
||||
PF_GETSPARKS = 1<<15, // Can get sparks
|
||||
PF_DRIFTEND = 1<<16, // Drift has ended, used to adjust character angle after drift
|
||||
PF_BRAKEDRIFT = 1<<17, // Helper for brake-drift spark spawning
|
||||
|
||||
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
|
||||
PF_AIRFAILSAFE = 1<<18, // Whenever or not try the air boost
|
||||
PF_UPDATEMYRESPAWN = 1<<19,
|
||||
|
||||
PF_AIRFAILSAFE = 1<<22, // Whenever or not try the air boost
|
||||
PF_UPDATEMYRESPAWN = 1<<23,
|
||||
PF_FLIPCAM = 1<<20,
|
||||
//free = 1<<21,
|
||||
|
||||
PF_FLIPCAM = 1<<24,
|
||||
//free = 1<<25,
|
||||
PF_HITFINISHLINE = 1<<22, // Already hit the finish line this tic
|
||||
PF_WRONGWAY = 1<<23, // Moving the wrong way with respect to waypoints?
|
||||
|
||||
PF_HITFINISHLINE = 1<<26, // Already hit the finish line this tic
|
||||
PF_WRONGWAY = 1<<27, // Moving the wrong way with respect to waypoints?
|
||||
|
||||
PF_SHRINKME = 1<<28, // "Shrink me" cheat preference
|
||||
PF_SHRINKACTIVE = 1<<29, // "Shrink me" cheat is in effect. (Can't be disabled mid-race)
|
||||
PF_SHRINKME = 1<<24, // "Shrink me" cheat preference
|
||||
PF_SHRINKACTIVE = 1<<25, // "Shrink me" cheat is in effect. (Can't be disabled mid-race)
|
||||
|
||||
// up to 1<<31 is free
|
||||
} pflags_t;
|
||||
|
|
@ -726,6 +728,8 @@ struct player_t
|
|||
|
||||
UINT8 kickstartaccel;
|
||||
|
||||
UINT8 itemflags; // holds IF_flags (see itemstate_t)
|
||||
|
||||
fixed_t outrun; // Milky Way road effect
|
||||
UINT8 outruntime; // Used to bypass the speed cap for fall off
|
||||
|
||||
|
|
|
|||
|
|
@ -305,6 +305,16 @@ static int ScanConstants(lua_State *L, boolean mathlib, const char *word)
|
|||
if (mathlib) return luaL_error(L, "playerflag '%s' could not be found.\n", word);
|
||||
return 0;
|
||||
}
|
||||
else if (fastncmp("IF_", word, 3)) {
|
||||
p = word+3;
|
||||
for (i = 0; ITEMFLAG_LIST[i]; i++)
|
||||
if (fastcmp(p, ITEMFLAG_LIST[i])) {
|
||||
CacheAndPushConstant(L, word, ((lua_Integer)1<<i));
|
||||
return 1;
|
||||
}
|
||||
if (mathlib) return luaL_error(L, "itemflag '%s' could not be found.\n", word);
|
||||
return 0;
|
||||
}
|
||||
else if (fastncmp("GT_", word, 3)) {
|
||||
p = word;
|
||||
for (i = 0; Gametype_ConstantNames[i]; i++)
|
||||
|
|
|
|||
|
|
@ -225,12 +225,6 @@ const char *const PLAYERFLAG_LIST[] = {
|
|||
|
||||
"RINGLOCK", // Prevent picking up rings while SPB is locked on
|
||||
|
||||
// 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
|
||||
|
||||
"DRIFTINPUT", // Drifting!
|
||||
"GETSPARKS", // Can get sparks
|
||||
"DRIFTEND", // Drift has ended, used to adjust character angle after drift
|
||||
|
|
@ -240,7 +234,7 @@ const char *const PLAYERFLAG_LIST[] = {
|
|||
|
||||
"UPDATEMYRESPAWN",
|
||||
"FLIPCAM",
|
||||
//free
|
||||
"\x01",
|
||||
|
||||
"HITFINISHLINE", // Already hit the finish line this tic
|
||||
"WRONGWAY", // Moving the wrong way with respect to waypoints?
|
||||
|
|
@ -251,6 +245,15 @@ const char *const PLAYERFLAG_LIST[] = {
|
|||
NULL // stop loop here.
|
||||
};
|
||||
|
||||
const char *const ITEMFLAG_LIST[] = {
|
||||
"USERINGS",
|
||||
"ITEMOUT",
|
||||
"IF_EGGMANOUT",
|
||||
"IF_HOLDREADY",
|
||||
|
||||
NULL // stop loop here.
|
||||
};
|
||||
|
||||
const char *const GAMETYPERULE_LIST[] = {
|
||||
"CAMPAIGN",
|
||||
"RINGSLINGER",
|
||||
|
|
|
|||
|
|
@ -67,6 +67,7 @@ extern const char *const MOBJFLAG2_LIST[]; // \tMF2_(\S+).*// (.+) --> \t"\1", /
|
|||
extern const char *const MOBJEFLAG_LIST[];
|
||||
extern const char *const MAPTHINGFLAG_LIST[4];
|
||||
extern const char *const PLAYERFLAG_LIST[];
|
||||
extern const char *const ITEMFLAG_LIST[];
|
||||
extern const char *const GAMETYPERULE_LIST[];
|
||||
extern const char *const ML_LIST[]; // Linedef flags
|
||||
extern const char *const MSF_LIST[]; // Sector flags
|
||||
|
|
|
|||
|
|
@ -2282,7 +2282,7 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps)
|
|||
totalring = players[player].totalring;
|
||||
xtralife = players[player].xtralife;
|
||||
|
||||
pflags = (players[player].pflags & (PF_WANTSTOJOIN|PF_KICKSTARTACCEL|PF_SHRINKME|PF_SHRINKACTIVE));
|
||||
pflags = (players[player].pflags & (PF_WANTSTOJOIN|PF_KICKSTARTACCEL|PF_SHRINKME|PF_SHRINKACTIVE|PF_FLIPCAM));
|
||||
|
||||
// SRB2kart
|
||||
if (betweenmaps || leveltime <= starttime || spectator == true)
|
||||
|
|
@ -2322,7 +2322,7 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps)
|
|||
itemroulette = (players[player].itemroulette > 0 ? 1 : 0);
|
||||
roulettetype = players[player].roulettetype;
|
||||
|
||||
if (players[player].pflags & PF_ITEMOUT)
|
||||
if (players[player].itemflags & IF_ITEMOUT)
|
||||
{
|
||||
itemtype = 0;
|
||||
itemamount = 0;
|
||||
|
|
|
|||
|
|
@ -457,7 +457,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->pflags & PF_ITEMOUT)
|
||||
if (player->itemflags & IF_ITEMOUT)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
@ -482,7 +482,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->pflags & PF_ITEMOUT)
|
||||
if (player->itemflags & IF_ITEMOUT)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
@ -828,7 +828,7 @@ static boolean K_BotRevealsEggbox(player_t *player)
|
|||
--------------------------------------------------*/
|
||||
static void K_BotItemEggmanShield(player_t *player, ticcmd_t *cmd)
|
||||
{
|
||||
if (player->pflags & PF_EGGMANOUT)
|
||||
if (player->itemflags & IF_EGGMANOUT)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
@ -1163,7 +1163,7 @@ static void K_BotItemBubble(player_t *player, ticcmd_t *cmd)
|
|||
hold = true;
|
||||
}
|
||||
|
||||
if (hold && (player->pflags & PF_HOLDREADY))
|
||||
if (hold && (player->itemflags & IF_HOLDREADY))
|
||||
{
|
||||
cmd->buttons |= BT_ATTACK;
|
||||
}
|
||||
|
|
@ -1187,7 +1187,7 @@ static void K_BotItemFlame(player_t *player, ticcmd_t *cmd)
|
|||
{
|
||||
player->botvars.itemconfirm--;
|
||||
}
|
||||
else if (player->pflags & PF_HOLDREADY)
|
||||
else if (player->itemflags & IF_HOLDREADY)
|
||||
{
|
||||
INT32 flamemax = player->flamelength * flameseg;
|
||||
|
||||
|
|
@ -1280,7 +1280,7 @@ static void K_BotItemRouletteMash(player_t *player, ticcmd_t *cmd)
|
|||
--------------------------------------------------*/
|
||||
void K_BotItemUsage(player_t *player, ticcmd_t *cmd, INT16 turnamt)
|
||||
{
|
||||
if (player->pflags & PF_USERINGS)
|
||||
if (player->itemflags & IF_USERINGS)
|
||||
{
|
||||
// Use rings!
|
||||
|
||||
|
|
@ -1311,7 +1311,7 @@ void K_BotItemUsage(player_t *player, ticcmd_t *cmd, INT16 turnamt)
|
|||
{
|
||||
K_BotItemEggmanExplosion(player, cmd);
|
||||
}
|
||||
else if (player->pflags & PF_EGGMANOUT)
|
||||
else if (player->itemflags & IF_EGGMANOUT)
|
||||
{
|
||||
K_BotItemEggman(player, cmd);
|
||||
}
|
||||
|
|
@ -1349,7 +1349,7 @@ void K_BotItemUsage(player_t *player, ticcmd_t *cmd, INT16 turnamt)
|
|||
K_BotItemSneaker(player, cmd);
|
||||
break;
|
||||
case KITEM_BANANA:
|
||||
if (!(player->pflags & PF_ITEMOUT))
|
||||
if (!(player->itemflags & IF_ITEMOUT))
|
||||
{
|
||||
K_BotItemGenericTrapShield(player, cmd, turnamt, false);
|
||||
}
|
||||
|
|
@ -1362,7 +1362,7 @@ void K_BotItemUsage(player_t *player, ticcmd_t *cmd, INT16 turnamt)
|
|||
K_BotItemEggmanShield(player, cmd);
|
||||
break;
|
||||
case KITEM_ORBINAUT:
|
||||
if (!(player->pflags & PF_ITEMOUT))
|
||||
if (!(player->itemflags & IF_ITEMOUT))
|
||||
{
|
||||
K_BotItemGenericOrbitShield(player, cmd);
|
||||
}
|
||||
|
|
@ -1374,7 +1374,7 @@ void K_BotItemUsage(player_t *player, ticcmd_t *cmd, INT16 turnamt)
|
|||
}
|
||||
break;
|
||||
case KITEM_JAWZ:
|
||||
if (!(player->pflags & PF_ITEMOUT))
|
||||
if (!(player->itemflags & IF_ITEMOUT))
|
||||
{
|
||||
K_BotItemGenericOrbitShield(player, cmd);
|
||||
}
|
||||
|
|
@ -1384,7 +1384,7 @@ void K_BotItemUsage(player_t *player, ticcmd_t *cmd, INT16 turnamt)
|
|||
}
|
||||
break;
|
||||
case KITEM_MINE:
|
||||
if (!(player->pflags & PF_ITEMOUT))
|
||||
if (!(player->itemflags & IF_ITEMOUT))
|
||||
{
|
||||
K_BotItemGenericTrapShield(player, cmd, turnamt, true);
|
||||
}
|
||||
|
|
@ -1397,7 +1397,7 @@ void K_BotItemUsage(player_t *player, ticcmd_t *cmd, INT16 turnamt)
|
|||
K_BotItemLandmine(player, cmd, turnamt);
|
||||
break;
|
||||
case KITEM_DROPTARGET:
|
||||
if (!(player->pflags & PF_ITEMOUT))
|
||||
if (!(player->itemflags & IF_ITEMOUT))
|
||||
{
|
||||
K_BotItemGenericTrapShield(player, cmd, turnamt, false);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -566,8 +566,8 @@ static BlockItReturn_t K_FindObjectsForNudging(mobj_t *thing)
|
|||
}
|
||||
// Has held item shield
|
||||
else if (K_PlayerAttackSteer(thing, side, 20,
|
||||
(thing->player->pflags & (PF_ITEMOUT|PF_EGGMANOUT)),
|
||||
(globalsmuggle.botmo->player->pflags & (PF_ITEMOUT|PF_EGGMANOUT))
|
||||
(thing->player->itemflags & (IF_ITEMOUT|IF_EGGMANOUT)),
|
||||
(globalsmuggle.botmo->player->pflags & (IF_ITEMOUT|IF_EGGMANOUT))
|
||||
))
|
||||
{
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -273,7 +273,7 @@ boolean K_EggItemCollide(mobj_t *t1, mobj_t *t2)
|
|||
if (t1->target->hnext == t1)
|
||||
{
|
||||
P_SetTarget(&t1->target->hnext, NULL);
|
||||
t1->target->player->pflags &= ~PF_EGGMANOUT;
|
||||
t1->target->player->itemflags &= ~IF_EGGMANOUT;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1255,7 +1255,7 @@ static void K_drawKartItem(void)
|
|||
break;
|
||||
}
|
||||
|
||||
if ((stplyr->pflags & PF_ITEMOUT) && !(leveltime & 1))
|
||||
if ((stplyr->itemflags & IF_ITEMOUT) && !(leveltime & 1))
|
||||
localpatch = kp_nodraw;
|
||||
}
|
||||
|
||||
|
|
|
|||
80
src/k_kart.c
80
src/k_kart.c
|
|
@ -1337,7 +1337,7 @@ static void K_KartItemRoulette(player_t *player, ticcmd_t *cmd)
|
|||
// I'm returning via the exact opposite, however, to forgo having another bracket embed. Same result either way, I think.
|
||||
// Finally, if you get past this check, now you can actually start calculating what item you get.
|
||||
if ((cmd->buttons & BT_ATTACK) && (player->itemroulette >= roulettestop)
|
||||
&& !(player->pflags & (PF_ITEMOUT|PF_EGGMANOUT|PF_USERINGS)))
|
||||
&& !(player->itemflags & (IF_ITEMOUT|IF_EGGMANOUT|IF_USERINGS)))
|
||||
{
|
||||
// Mashing reduces your chances for the good items
|
||||
mashed = FixedDiv((player->itemroulette)*FRACUNIT, ((TICRATE*3)+roulettestop)*FRACUNIT) - FRACUNIT;
|
||||
|
|
@ -4990,7 +4990,7 @@ static void K_DoHyudoroSteal(player_t *player)
|
|||
// Has an item
|
||||
&& (players[i].itemtype
|
||||
&& players[i].itemamount
|
||||
&& !(players[i].pflags & PF_ITEMOUT)))
|
||||
&& !(players[i].itemflags & IF_ITEMOUT)))
|
||||
{
|
||||
playerswappable[numplayers] = i;
|
||||
numplayers++;
|
||||
|
|
@ -5568,11 +5568,11 @@ void K_DropHnextList(player_t *player, boolean keepshields)
|
|||
|
||||
player->bananadrag = 0;
|
||||
|
||||
if (player->pflags & PF_EGGMANOUT)
|
||||
if (player->itemflags & IF_EGGMANOUT)
|
||||
{
|
||||
player->pflags &= ~PF_EGGMANOUT;
|
||||
player->itemflags &= ~IF_EGGMANOUT;
|
||||
}
|
||||
else if ((player->pflags & PF_ITEMOUT)
|
||||
else if ((player->itemflags & IF_ITEMOUT)
|
||||
&& (dropall || (--player->itemamount <= 0)))
|
||||
{
|
||||
player->itemamount = 0;
|
||||
|
|
@ -5958,9 +5958,9 @@ static void K_MoveHeldObjects(player_t *player)
|
|||
if (!player->mo->hnext)
|
||||
{
|
||||
player->bananadrag = 0;
|
||||
if (player->pflags & PF_EGGMANOUT)
|
||||
player->pflags &= ~PF_EGGMANOUT;
|
||||
else if (player->pflags & PF_ITEMOUT)
|
||||
if (player->itemflags & IF_EGGMANOUT)
|
||||
player->itemflags &= ~IF_EGGMANOUT;
|
||||
else if (player->itemflags & IF_ITEMOUT)
|
||||
{
|
||||
player->itemamount = 0;
|
||||
K_UnsetItemOut(player);
|
||||
|
|
@ -5974,9 +5974,9 @@ static void K_MoveHeldObjects(player_t *player)
|
|||
// we need this here too because this is done in afterthink - pointers are cleaned up at the START of each tic...
|
||||
P_SetTarget(&player->mo->hnext, NULL);
|
||||
player->bananadrag = 0;
|
||||
if (player->pflags & PF_EGGMANOUT)
|
||||
player->pflags &= ~PF_EGGMANOUT;
|
||||
else if (player->pflags & PF_ITEMOUT)
|
||||
if (player->itemflags & IF_EGGMANOUT)
|
||||
player->itemflags &= ~IF_EGGMANOUT;
|
||||
else if (player->itemflags & IF_EGGMANOUT)
|
||||
{
|
||||
player->itemamount = 0;
|
||||
K_UnsetItemOut(player);
|
||||
|
|
@ -6986,7 +6986,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
|
|||
}
|
||||
|
||||
if (player->itemtype == KITEM_NONE)
|
||||
player->pflags &= ~PF_HOLDREADY;
|
||||
player->itemflags &= ~IF_HOLDREADY;
|
||||
|
||||
// DKR style camera for boosting
|
||||
if (player->karthud[khud_boostcam] != 0 || player->karthud[khud_destboostcam] != 0)
|
||||
|
|
@ -7421,7 +7421,7 @@ void K_KartPlayerAfterThink(player_t *player)
|
|||
K_MoveHeldObjects(player);
|
||||
|
||||
// Jawz reticule (seeking)
|
||||
if (player->itemtype == KITEM_JAWZ && (player->pflags & PF_ITEMOUT))
|
||||
if (player->itemtype == KITEM_JAWZ && (player->itemflags & IF_ITEMOUT))
|
||||
{
|
||||
INT32 lasttarg = player->lastjawztarget;
|
||||
player_t *targ;
|
||||
|
|
@ -8865,7 +8865,7 @@ void K_StripItems(player_t *player)
|
|||
K_DropKitchenSink(player);
|
||||
player->itemtype = KITEM_NONE;
|
||||
player->itemamount = 0;
|
||||
player->pflags &= ~(PF_ITEMOUT|PF_EGGMANOUT);
|
||||
player->itemflags &= ~(IF_ITEMOUT|IF_EGGMANOUT);
|
||||
|
||||
if (!player->itemroulette || player->roulettetype != 2)
|
||||
{
|
||||
|
|
@ -9040,12 +9040,12 @@ void K_SetTireGrease(player_t *player, tic_t tics)
|
|||
|
||||
void K_SetItemOut(player_t *player)
|
||||
{
|
||||
player->pflags |= PF_ITEMOUT;
|
||||
player->itemflags |= IF_ITEMOUT;
|
||||
}
|
||||
|
||||
void K_UnsetItemOut(player_t *player)
|
||||
{
|
||||
player->pflags &= ~PF_ITEMOUT;
|
||||
player->itemflags &= ~IF_ITEMOUT;
|
||||
player->bananadrag = 0;
|
||||
}
|
||||
|
||||
|
|
@ -9056,7 +9056,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
|
|||
{
|
||||
ticcmd_t *cmd = &player->cmd;
|
||||
boolean ATTACK_IS_DOWN = ((cmd->buttons & BT_ATTACK) && !(player->oldcmd.buttons & BT_ATTACK));
|
||||
boolean HOLDING_ITEM = (player->pflags & (PF_ITEMOUT|PF_EGGMANOUT));
|
||||
boolean HOLDING_ITEM = (player->itemflags & (IF_ITEMOUT|IF_EGGMANOUT));
|
||||
boolean NO_HYUDORO = (player->stealingtimer == 0 && player->stolentimer == 0);
|
||||
|
||||
if (!player->exiting)
|
||||
|
|
@ -9086,9 +9086,9 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
|
|||
|| player->rocketsneakertimer
|
||||
|| player->eggmanexplode
|
||||
|| (player->growshrinktimer > 0)))
|
||||
player->pflags |= PF_USERINGS;
|
||||
player->pflags |= IF_USERINGS;
|
||||
else
|
||||
player->pflags &= ~PF_USERINGS;
|
||||
player->pflags &= ~IF_USERINGS;
|
||||
}
|
||||
|
||||
if (player && player->mo && player->mo->health > 0 && !player->spectator && !P_PlayerInPain(player) && !(player->exiting || mapreset) && leveltime > introtime)
|
||||
|
|
@ -9125,7 +9125,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
|
|||
S_StartSound(player->mo, sfx_s254);
|
||||
}
|
||||
// Ring boosting
|
||||
else if (player->pflags & PF_USERINGS)
|
||||
else if (player->itemflags & IF_USERINGS)
|
||||
{
|
||||
if ((cmd->buttons & BT_ATTACK) && !player->ringdelay && player->rings > 0)
|
||||
{
|
||||
|
|
@ -9149,13 +9149,13 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
|
|||
player->eggmanexplode = 1;
|
||||
}
|
||||
// Eggman Monitor throwing
|
||||
else if (player->pflags & PF_EGGMANOUT)
|
||||
else if (player->itemflags & IF_EGGMANOUT)
|
||||
{
|
||||
if (ATTACK_IS_DOWN)
|
||||
{
|
||||
K_ThrowKartItem(player, false, MT_EGGMANITEM, -1, 0);
|
||||
K_PlayAttackTaunt(player->mo);
|
||||
player->pflags &= ~PF_EGGMANOUT;
|
||||
player->itemflags &= ~IF_EGGMANOUT;
|
||||
K_UpdateHnextList(player, true);
|
||||
}
|
||||
}
|
||||
|
|
@ -9280,7 +9280,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
|
|||
prev = mo;
|
||||
}
|
||||
}
|
||||
else if (ATTACK_IS_DOWN && (player->pflags & PF_ITEMOUT)) // Banana x3 thrown
|
||||
else if (ATTACK_IS_DOWN && (player->itemflags & IF_ITEMOUT)) // Banana x3 thrown
|
||||
{
|
||||
player->itemamount--;
|
||||
K_ThrowKartItem(player, false, MT_BANANA, -1, 0);
|
||||
|
|
@ -9293,7 +9293,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
|
|||
{
|
||||
mobj_t *mo;
|
||||
player->itemamount--;
|
||||
player->pflags |= PF_EGGMANOUT;
|
||||
player->itemflags |= IF_EGGMANOUT;
|
||||
S_StartSound(player->mo, sfx_s254);
|
||||
mo = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_EGGMANITEM_SHIELD);
|
||||
if (mo)
|
||||
|
|
@ -9341,7 +9341,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
|
|||
prev = mo;
|
||||
}
|
||||
}
|
||||
else if (ATTACK_IS_DOWN && (player->pflags & PF_ITEMOUT)) // Orbinaut x3 thrown
|
||||
else if (ATTACK_IS_DOWN && (player->itemflags & IF_ITEMOUT)) // Orbinaut x3 thrown
|
||||
{
|
||||
player->itemamount--;
|
||||
K_ThrowKartItem(player, true, MT_ORBINAUT, 1, 0);
|
||||
|
|
@ -9381,7 +9381,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
|
|||
prev = mo;
|
||||
}
|
||||
}
|
||||
else if (ATTACK_IS_DOWN && HOLDING_ITEM && (player->pflags & PF_ITEMOUT)) // Jawz thrown
|
||||
else if (ATTACK_IS_DOWN && HOLDING_ITEM && (player->itemflags & IF_ITEMOUT)) // Jawz thrown
|
||||
{
|
||||
player->itemamount--;
|
||||
if (player->throwdir == 1 || player->throwdir == 0)
|
||||
|
|
@ -9409,12 +9409,12 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
|
|||
P_SetTarget(&player->mo->hnext, mo);
|
||||
}
|
||||
}
|
||||
else if (ATTACK_IS_DOWN && (player->pflags & PF_ITEMOUT))
|
||||
else if (ATTACK_IS_DOWN && (player->itemflags & IF_ITEMOUT))
|
||||
{
|
||||
player->itemamount--;
|
||||
K_ThrowKartItem(player, false, MT_SSMINE, 1, 1);
|
||||
K_PlayAttackTaunt(player->mo);
|
||||
player->pflags &= ~PF_ITEMOUT;
|
||||
player->itemflags &= ~IF_ITEMOUT;
|
||||
K_UpdateHnextList(player, true);
|
||||
}
|
||||
break;
|
||||
|
|
@ -9443,12 +9443,12 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
|
|||
P_SetTarget(&player->mo->hnext, mo);
|
||||
}
|
||||
}
|
||||
else if (ATTACK_IS_DOWN && (player->pflags & PF_ITEMOUT))
|
||||
else if (ATTACK_IS_DOWN && (player->itemflags & IF_ITEMOUT))
|
||||
{
|
||||
player->itemamount--;
|
||||
K_ThrowKartItem(player, (player->throwdir > 0), MT_DROPTARGET, -1, 0);
|
||||
K_PlayAttackTaunt(player->mo);
|
||||
player->pflags &= ~PF_ITEMOUT;
|
||||
player->itemflags &= ~IF_ITEMOUT;
|
||||
K_UpdateHnextList(player, true);
|
||||
}
|
||||
break;
|
||||
|
|
@ -9556,7 +9556,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
|
|||
|
||||
if (!HOLDING_ITEM && NO_HYUDORO)
|
||||
{
|
||||
if ((cmd->buttons & BT_ATTACK) && (player->pflags & PF_HOLDREADY))
|
||||
if ((cmd->buttons & BT_ATTACK) && (player->itemflags & IF_HOLDREADY))
|
||||
{
|
||||
if (player->bubbleblowup == 0)
|
||||
S_StartSound(player->mo, sfx_s3k75);
|
||||
|
|
@ -9571,7 +9571,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
|
|||
K_PlayAttackTaunt(player->mo);
|
||||
player->bubbleblowup = 0;
|
||||
player->bubblecool = 0;
|
||||
player->pflags &= ~PF_HOLDREADY;
|
||||
player->itemflags &= ~IF_HOLDREADY;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -9583,9 +9583,9 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
|
|||
player->bubbleblowup--;
|
||||
|
||||
if (player->bubblecool)
|
||||
player->pflags &= ~PF_HOLDREADY;
|
||||
player->itemflags &= ~IF_HOLDREADY;
|
||||
else
|
||||
player->pflags |= PF_HOLDREADY;
|
||||
player->itemflags |= IF_HOLDREADY;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
@ -9611,7 +9611,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
|
|||
if (flamemax > 0)
|
||||
flamemax += TICRATE; // leniency period
|
||||
|
||||
if ((cmd->buttons & BT_ATTACK) && (player->pflags & PF_HOLDREADY))
|
||||
if ((cmd->buttons & BT_ATTACK) && (player->itemflags & IF_HOLDREADY))
|
||||
{
|
||||
// TODO: gametyperules
|
||||
const INT32 incr = gametype == GT_BATTLE ? 4 : 2;
|
||||
|
|
@ -9642,13 +9642,13 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
|
|||
|
||||
player->flamemeter = 0;
|
||||
player->flamelength = 0;
|
||||
player->pflags &= ~PF_HOLDREADY;
|
||||
player->itemflags &= ~IF_HOLDREADY;
|
||||
player->itemamount--;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
player->pflags |= PF_HOLDREADY;
|
||||
player->itemflags |= IF_HOLDREADY;
|
||||
|
||||
// TODO: gametyperules
|
||||
if (gametype != GT_BATTLE || leveltime % 6 == 0)
|
||||
|
|
@ -9712,12 +9712,12 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
|
|||
P_SetTarget(&player->mo->hnext, mo);
|
||||
}
|
||||
}
|
||||
else if (ATTACK_IS_DOWN && HOLDING_ITEM && (player->pflags & PF_ITEMOUT)) // Sink thrown
|
||||
else if (ATTACK_IS_DOWN && HOLDING_ITEM && (player->itemflags & IF_ITEMOUT)) // Sink thrown
|
||||
{
|
||||
player->itemamount--;
|
||||
K_ThrowKartItem(player, false, MT_SINK, 1, 2);
|
||||
K_PlayAttackTaunt(player->mo);
|
||||
player->pflags &= ~PF_ITEMOUT;
|
||||
player->itemflags &= ~IF_ITEMOUT;
|
||||
K_UpdateHnextList(player, true);
|
||||
}
|
||||
break;
|
||||
|
|
@ -9740,7 +9740,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
|
|||
// No more!
|
||||
if (!player->itemamount)
|
||||
{
|
||||
player->pflags &= ~PF_ITEMOUT;
|
||||
player->itemflags &= ~IF_ITEMOUT;
|
||||
player->itemtype = KITEM_NONE;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1121,7 +1121,7 @@ static int kartstuff_get(lua_State *L)
|
|||
lua_pushinteger(L, plr->itemamount);
|
||||
return 1;
|
||||
case k_itemheld:
|
||||
lua_pushinteger(L, (plr->pflags & PF_ITEMOUT));
|
||||
lua_pushinteger(L, (plr->itemflags & IF_ITEMOUT));
|
||||
return 1;
|
||||
case k_curshield:
|
||||
lua_pushinteger(L, plr->curshield);
|
||||
|
|
@ -1151,7 +1151,7 @@ static int kartstuff_get(lua_State *L)
|
|||
lua_pushinteger(L, plr->invincibilitytimer);
|
||||
return 1;
|
||||
case k_eggmanheld:
|
||||
lua_pushinteger(L, (plr->pflags & PF_EGGMANOUT));
|
||||
lua_pushinteger(L, (plr->itemflags & IF_EGGMANOUT));
|
||||
return 1;
|
||||
case k_eggmanexplode:
|
||||
lua_pushinteger(L, plr->eggmanexplode);
|
||||
|
|
@ -1383,7 +1383,7 @@ static int kartstuff_set(lua_State *L)
|
|||
break;
|
||||
case k_itemheld:
|
||||
if (i > 0)
|
||||
plr->pflags |= PF_ITEMOUT;
|
||||
plr->itemflags |= IF_ITEMOUT;
|
||||
break;
|
||||
case k_curshield:
|
||||
plr->curshield = i;
|
||||
|
|
@ -1414,7 +1414,7 @@ static int kartstuff_set(lua_State *L)
|
|||
break;
|
||||
case k_eggmanheld:
|
||||
if (i > 0)
|
||||
plr->pflags |= PF_EGGMANOUT;
|
||||
plr->itemflags |= IF_EGGMANOUT;
|
||||
break;
|
||||
case k_eggmanexplode:
|
||||
plr->eggmanexplode = i;
|
||||
|
|
|
|||
|
|
@ -153,7 +153,7 @@ boolean P_CanPickupItem(player_t *player, UINT8 weapon)
|
|||
// Item slot already taken up
|
||||
if (player->itemroulette
|
||||
|| (weapon != 3 && player->itemamount)
|
||||
|| (player->pflags & PF_ITEMOUT))
|
||||
|| (player->itemflags & IF_ITEMOUT))
|
||||
return false;
|
||||
|
||||
if (weapon == 3 && K_GetShieldFromItem(player->itemtype) != KSHIELD_NONE)
|
||||
|
|
@ -1106,10 +1106,10 @@ 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 (!P_MobjWasRemoved(target->target) && target->target->player && !P_MobjWasRemoved(target->target->player->mo))
|
||||
{
|
||||
if ((target->target->player->pflags & PF_EGGMANOUT) && target->type == MT_EGGMANITEM_SHIELD)
|
||||
target->target->player->pflags &= ~PF_EGGMANOUT;
|
||||
if ((target->target->player->itemflags & IF_EGGMANOUT) && target->type == MT_EGGMANITEM_SHIELD)
|
||||
target->target->player->itemflags &= ~IF_EGGMANOUT;
|
||||
|
||||
if (target->target->player->pflags & PF_ITEMOUT)
|
||||
if (target->target->player->itemflags & IF_ITEMOUT)
|
||||
{
|
||||
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)
|
||||
|
|
@ -1137,7 +1137,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget
|
|||
}
|
||||
|
||||
if (!target->target->player->itemamount)
|
||||
target->target->player->pflags &= ~PF_ITEMOUT;
|
||||
target->target->player->itemflags &= ~IF_ITEMOUT;
|
||||
|
||||
if (target->target->hnext == target)
|
||||
P_SetTarget(&target->target->hnext, NULL);
|
||||
|
|
|
|||
|
|
@ -6155,7 +6155,7 @@ static void P_MobjSceneryThink(mobj_t *mobj)
|
|||
break;
|
||||
}
|
||||
|
||||
if (mobj->target->player->pflags & PF_ITEMOUT)
|
||||
if (mobj->target->player->itemflags & IF_ITEMOUT)
|
||||
{
|
||||
if (leveltime & 1)
|
||||
mobj->tracer->renderflags &= ~RF_DONTDRAW;
|
||||
|
|
|
|||
|
|
@ -346,6 +346,8 @@ static void P_NetArchivePlayers(savebuffer_t *save)
|
|||
|
||||
WRITEUINT8(save->p, players[i].kickstartaccel);
|
||||
|
||||
WRITEUINT8(save->p, players[i].itemflags);
|
||||
|
||||
// botvars_t
|
||||
WRITEUINT8(save->p, players[i].botvars.difficulty);
|
||||
WRITEUINT8(save->p, players[i].botvars.diffincrease);
|
||||
|
|
@ -638,6 +640,8 @@ static void P_NetUnArchivePlayers(savebuffer_t *save)
|
|||
|
||||
players[i].kickstartaccel = READUINT8(save->p);
|
||||
|
||||
players[i].itemflags = READUINT8(save->p);
|
||||
|
||||
// botvars_t
|
||||
players[i].botvars.difficulty = READUINT8(save->p);
|
||||
players[i].botvars.diffincrease = READUINT8(save->p);
|
||||
|
|
|
|||
Loading…
Reference in a new issue