Class CustomGrenade
- Namespace
- Exiled.CustomItems.API.Features
- Assembly
- Exiled.CustomItems.dll
The Custom Grenade base class.
public abstract class CustomGrenade : CustomItem
- Inheritance
-
CustomGrenade
- Inherited Members
- Extension Methods
Properties
ExplodeOnCollision
Gets or sets a value indicating whether gets or sets a value that determines if the grenade should explode immediately when contacting any surface.
public abstract bool ExplodeOnCollision { get; set; }
Property Value
FuseTime
Gets or sets a value indicating how long the grenade's fuse time should be.
public abstract float FuseTime { get; set; }
Property Value
Type
Gets or sets the ItemType to use for this item.
public override ItemType Type { get; set; }
Property Value
- ItemType
Methods
Check(Projectile)
Checks to see if the grenade is a custom grenade.
public virtual bool Check(Projectile grenade)
Parameters
grenade
ProjectileThe grenade to check.
Returns
- bool
True if it is a custom grenade.
OnChangedIntoGrenade(ChangedIntoGrenadeEventArgs)
Handles the tracking of custom grenade pickups that are changed into live grenades by a frag grenade explosion.
protected virtual void OnChangedIntoGrenade(ChangedIntoGrenadeEventArgs ev)
Parameters
OnExploding(ExplodingGrenadeEventArgs)
Handles tracking exploded custom grenades.
protected virtual void OnExploding(ExplodingGrenadeEventArgs ev)
Parameters
OnThrowingRequest(ThrowingRequestEventArgs)
Handles tracking thrown requests by custom grenades.
protected virtual void OnThrowingRequest(ThrowingRequestEventArgs ev)
Parameters
OnThrownProjectile(ThrownProjectileEventArgs)
Handles tracking thrown custom grenades.
protected virtual void OnThrownProjectile(ThrownProjectileEventArgs ev)
Parameters
SubscribeEvents()
Called after the manager is initialized, to allow loading of special event handlers.
protected override void SubscribeEvents()
Throw(Vector3, float, float, float, ItemType, Player?)
Throw the CustomGrenade object.
public virtual Pickup Throw(Vector3 position, float force, float weight, float fuseTime = 3, ItemType grenadeType = ItemType.GrenadeHE, Player? player = null)
Parameters
position
Vector3The UnityEngine.Vector3position to throw at.
force
floatThe amount of force to throw with.
weight
floatThe floatWeight of the Grenade.
fuseTime
floatThe floatFuseTime of the grenade.
grenadeType
ItemTypeThe ItemTypeof the grenade to spawn.
player
PlayerThe Player to count as the thrower of the grenade.
Returns
UnsubscribeEvents()
Called when the manager is being destroyed, to allow unloading of special event handlers.
protected override void UnsubscribeEvents()