Grenade Base item
Item defined in core/items/sh_grenade_base.lua
Defines the grenade_base base item for throwable grenades, built on weapon_base.
Equipping gives one round of grenade spawn ammo, which holstering or dropping takes back. Once the grenade has
been thrown and no ammo is left, trying to holster or drop it strips the weapon instead.
Summary
Methods
extraData is 'drop'.Methods
ITEM:CanDropWeapon(player, attacker, bNoMsg)
shared gamemodes/catwork/gamemode/core/items/sh_grenade_base.lua:18Allows dropping while the player has grenade ammo; without ammo it strips the weapon and takes the item.
Parameters
- player
- attacker
- bNoMsg
Returns
- Boolean Whether the weapon may be dropped
ITEM:CanHolsterWeapon(player, forceHolster, bNoMsg)
shared gamemodes/catwork/gamemode/core/items/sh_grenade_base.lua:31Allows holstering while the player has grenade ammo; without ammo it strips the weapon.
Parameters
- player
- forceHolster
- bNoMsg
Returns
- Boolean Whether the weapon may be holstered
Gives the player one grenade of spawn ammo when the grenade is equipped.
Parameters
- player
ITEM:OnPlayerUnequipped(player, extraData)
shared gamemodes/catwork/gamemode/core/items/sh_grenade_base.lua:45Holsters the grenade back into the inventory, or drops it where the player looks when extraData is 'drop'.
Runs PlayerCanHolsterWeapon/PlayerHolsterWeapon or PlayerCanDropWeapon/PlayerDropWeapon, and takes
the grenade's spawn ammo away in both cases.
Parameters
- player
- extraData