Class CustomGrenade
The Custom Grenade base class.
Inherited Members
Namespace: Exiled.CustomItems.API.Features
Assembly: Exiled.CustomItems.dll
Syntax
public abstract class CustomGrenade : CustomItem
Properties
| Improve this Doc View SourceExplodeOnCollision
Gets or sets a value indicating whether gets or sets a value that determines if the grenade should explode immediately when contacting any surface.
Declaration
public abstract bool ExplodeOnCollision { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
FuseTime
Gets or sets a value indicating how long the grenade's fuse time should be.
Declaration
public abstract float FuseTime { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
Type
Gets or sets the ItemType to use for this item.
Declaration
public override ItemType Type { get; set; }
Property Value
Type | Description |
---|---|
ItemType |
Overrides
Methods
| Improve this Doc View SourceCheck(Projectile)
Checks to see if the grenade is a custom grenade.
Declaration
public virtual bool Check(Projectile grenade)
Parameters
Type | Name | Description |
---|---|---|
Projectile | grenade | The grenade to check. |
Returns
Type | Description |
---|---|
System.Boolean | 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.
Declaration
protected virtual void OnChangedIntoGrenade(ChangedIntoGrenadeEventArgs ev)
Parameters
Type | Name | Description |
---|---|---|
ChangedIntoGrenadeEventArgs | ev |
OnExploding(ExplodingGrenadeEventArgs)
Handles tracking exploded custom grenades.
Declaration
protected virtual void OnExploding(ExplodingGrenadeEventArgs ev)
Parameters
Type | Name | Description |
---|---|---|
ExplodingGrenadeEventArgs | ev |
OnThrowingRequest(ThrowingRequestEventArgs)
Handles tracking thrown requests by custom grenades.
Declaration
protected virtual void OnThrowingRequest(ThrowingRequestEventArgs ev)
Parameters
Type | Name | Description |
---|---|---|
ThrowingRequestEventArgs | ev |
OnThrownProjectile(ThrownProjectileEventArgs)
Handles tracking thrown custom grenades.
Declaration
protected virtual void OnThrownProjectile(ThrownProjectileEventArgs ev)
Parameters
Type | Name | Description |
---|---|---|
ThrownProjectileEventArgs | ev |
SubscribeEvents()
Declaration
protected override void SubscribeEvents()
Overrides
| Improve this Doc View SourceThrow(Vector3, Single, Single, Single, ItemType, Player)
Throw the CustomGrenade object.
Declaration
public virtual Pickup Throw(Vector3 position, float force, float weight, float fuseTime = 3F, ItemType grenadeType = ItemType.GrenadeHE, Player player = null)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Vector3 | position | The UnityEngine.Vector3position to throw at. |
System.Single | force | The amount of force to throw with. |
System.Single | weight | The System.SingleWeight of the Grenade. |
System.Single | fuseTime | The System.SingleFuseTime of the grenade. |
ItemType | grenadeType | The ItemTypeof the grenade to spawn. |
Player | player | The Player to count as the thrower of the grenade. |
Returns
Type | Description |
---|---|
Pickup | The Pickup spawned. |
UnsubscribeEvents()
Declaration
protected override void UnsubscribeEvents()