mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-01-17 23:21:05 +00:00
New pickup conditions for fakes
Instead of checking for item slot, it checks for invincibility or if you already have a fake
This commit is contained in:
parent
ff893f8f63
commit
4ea7c26c11
1 changed files with 30 additions and 9 deletions
|
@ -160,16 +160,37 @@ boolean P_CanPickupItem(player_t *player, UINT8 weapon)
|
|||
|
||||
if (weapon)
|
||||
{
|
||||
if (player->kartstuff[k_stealingtimer] || player->kartstuff[k_stolentimer]
|
||||
|| player->kartstuff[k_growshrinktimer] != 0 || player->kartstuff[k_rocketsneakertimer]
|
||||
|| player->kartstuff[k_eggmanexplode]) // Item-specific timer going off
|
||||
return false;
|
||||
// Item slot already taken up
|
||||
if (weapon == 2)
|
||||
{
|
||||
// Invulnerable
|
||||
if (player->powers[pw_flashing] > 0
|
||||
|| player->kartstuff[k_spinouttimer] > 0
|
||||
|| player->kartstuff[k_squishedtimer] > 0
|
||||
|| player->kartstuff[k_invincibilitytimer] > 0
|
||||
|| player->kartstuff[k_growshrinktimer] > 0
|
||||
|| player->kartstuff[k_hyudorotimer] > 0)
|
||||
return false;
|
||||
|
||||
if ((player->kartstuff[k_itemroulette] && weapon != 2)
|
||||
|| (player->kartstuff[k_roulettetype] == 2 && weapon == 2)
|
||||
|| player->kartstuff[k_itemamount]
|
||||
|| player->kartstuff[k_itemheld]) // Item slot already taken up
|
||||
return false;
|
||||
// Already have fake
|
||||
if (player->kartstuff[k_roulettetype] == 2
|
||||
|| player->kartstuff[k_eggmanexplode])
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Item-specific timer going off
|
||||
if (player->kartstuff[k_stealingtimer] || player->kartstuff[k_stolentimer]
|
||||
|| player->kartstuff[k_growshrinktimer] != 0 || player->kartstuff[k_rocketsneakertimer]
|
||||
|| player->kartstuff[k_eggmanexplode])
|
||||
return false;
|
||||
|
||||
// Item slot already taken up
|
||||
if (player->kartstuff[k_itemroulette]
|
||||
|| player->kartstuff[k_itemamount]
|
||||
|| player->kartstuff[k_itemheld])
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
Loading…
Reference in a new issue