mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Replace further P_CanPickupItem constants and allow them to be parsed in Lua
This commit is contained in:
parent
22817ac60b
commit
ca06b2a334
6 changed files with 13 additions and 8 deletions
|
|
@ -5251,6 +5251,11 @@ struct int_const_s const INT_CONST[] = {
|
|||
{"TN_CHANGEPITCH",TN_CHANGEPITCH},
|
||||
{"TN_LOOPING",TN_LOOPING},
|
||||
|
||||
{"PICKUP_RINGORSPHERE", PICKUP_RINGORSPHERE},
|
||||
{"PICKUP_ITEMBOX", PICKUP_ITEMBOX},
|
||||
{"PICKUP_EGGBOX", PICKUP_EGGBOX},
|
||||
{"PICKUP_PAPERITEM", PICKUP_PAPERITEM},
|
||||
|
||||
{NULL,0}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -497,7 +497,7 @@ static BlockItReturn_t K_FindObjectsForNudging(mobj_t *thing)
|
|||
break;
|
||||
}
|
||||
|
||||
if (P_CanPickupItem(g_nudgeSearch.botmo->player, 1))
|
||||
if (P_CanPickupItem(g_nudgeSearch.botmo->player, PICKUP_ITEMBOX))
|
||||
{
|
||||
K_AddAttackObject(thing, side, ((thing->extravalue1 < RINGBOX_TIME) ? 10 : 20));
|
||||
}
|
||||
|
|
@ -508,7 +508,7 @@ static BlockItReturn_t K_FindObjectsForNudging(mobj_t *thing)
|
|||
break;
|
||||
}
|
||||
|
||||
if (P_CanPickupItem(g_nudgeSearch.botmo->player, 1)) // Can pick up an actual item
|
||||
if (P_CanPickupItem(g_nudgeSearch.botmo->player, PICKUP_ITEMBOX)) // Can pick up an actual item
|
||||
{
|
||||
const UINT8 stealth = K_EggboxStealth(thing->x, thing->y);
|
||||
const UINT8 requiredstealth = (g_nudgeSearch.botmo->player->botvars.difficulty * g_nudgeSearch.botmo->player->botvars.difficulty);
|
||||
|
|
@ -529,7 +529,7 @@ static BlockItReturn_t K_FindObjectsForNudging(mobj_t *thing)
|
|||
break;
|
||||
}
|
||||
|
||||
if (P_CanPickupItem(g_nudgeSearch.botmo->player, 3))
|
||||
if (P_CanPickupItem(g_nudgeSearch.botmo->player, PICKUP_PAPERITEM))
|
||||
{
|
||||
K_AddAttackObject(thing, side, 20);
|
||||
}
|
||||
|
|
@ -542,7 +542,7 @@ static BlockItReturn_t K_FindObjectsForNudging(mobj_t *thing)
|
|||
}
|
||||
|
||||
if ((RINGTOTAL(g_nudgeSearch.botmo->player) < 20 && !(g_nudgeSearch.botmo->player->pflags & PF_RINGLOCK)
|
||||
&& P_CanPickupItem(g_nudgeSearch.botmo->player, 0))
|
||||
&& P_CanPickupItem(g_nudgeSearch.botmo->player, PICKUP_RINGORSPHERE))
|
||||
&& !thing->extravalue1
|
||||
&& (g_nudgeSearch.botmo->player->itemtype != KITEM_LIGHTNINGSHIELD))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -172,7 +172,7 @@ boolean K_EggItemCollide(mobj_t *t1, mobj_t *t2)
|
|||
if (t1->health <= 0 || t2->health <= 0)
|
||||
return true;
|
||||
|
||||
if (!P_CanPickupItem(t2->player, 2))
|
||||
if (!P_CanPickupItem(t2->player, PICKUP_EGGBOX))
|
||||
return true;
|
||||
|
||||
K_DropItems(t2->player);
|
||||
|
|
|
|||
|
|
@ -10066,7 +10066,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
|
|||
}
|
||||
|
||||
extern consvar_t cv_fuzz;
|
||||
if (cv_fuzz.value && P_CanPickupItem(player, 1))
|
||||
if (cv_fuzz.value && P_CanPickupItem(player, PICKUP_ITEMBOX))
|
||||
{
|
||||
K_StartItemRoulette(player, P_RandomRange(PR_FUZZ, 0, 1));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -629,7 +629,7 @@ award_immediately (mobj_t *hyu)
|
|||
return false;
|
||||
}
|
||||
|
||||
if (!P_CanPickupItem(player, 1))
|
||||
if (!P_CanPickupItem(player, PICKUP_ITEMBOX))
|
||||
return false;
|
||||
|
||||
// Prevent receiving any more items or even stacked
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ static player_t *GetItemBoxPlayer(mobj_t *mobj)
|
|||
}
|
||||
|
||||
// Always use normal item box rules -- could pass in "2" for fakes but they blend in better like this
|
||||
if (P_CanPickupItem(&players[i], 1))
|
||||
if (P_CanPickupItem(&players[i], PICKUP_ITEMBOX))
|
||||
{
|
||||
// Check for players who can take this pickup, but won't be allowed to (antifarming)
|
||||
UINT8 mytype = (mobj->flags2 & MF2_BOSSDEAD) ? 2 : 1;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue