Class ShotEventArgs
Contains all information after a player has fired a weapon.
public class ShotEventArgs : IFirearmEvent, IItemEvent, IPlayerEvent, IExiledEvent
- Inheritance
-
ShotEventArgs
- Implements
- Inherited Members
- Extension Methods
Constructors
ShotEventArgs(HitscanHitregModuleBase, RaycastHit, Firearm, IDestructible)
Initializes a new instance of the ShotEventArgs class.
public ShotEventArgs(HitscanHitregModuleBase hitregModule, RaycastHit hitInfo, Firearm firearm, IDestructible destructible)
Parameters
hitregModule
HitscanHitregModuleBaseHitreg module that calculated the shot.
hitInfo
RaycastHitRaycast hit info.
firearm
FirearmThe firearm used.
destructible
IDestructibleThe IDestructible that was hit. Can be null.
Properties
CanHurt
Gets or sets a value indicating whether the shot can deal damage.
public bool CanHurt { get; set; }
Property Value
CanSpawnImpactEffects
Gets or sets a value indicating whether the shot can produce impact effects (e.g. bullet holes).
public bool CanSpawnImpactEffects { get; set; }
Property Value
Damage
Gets the firearm base damage at the hit distance. Actual inflicted damage may vary.
public float Damage { get; }
Property Value
Destructible
Gets the IDestructible component of the hit collider. Can be null.
public IDestructible Destructible { get; }
Property Value
- IDestructible
Distance
Gets the bullet travel distance.
public float Distance { get; }
Property Value
Firearm
Gets the firearm used to fire the shot.
public Firearm Firearm { get; }
Property Value
Hitbox
Gets the HitboxIdentity component of the target player that was hit. Can be null.
public HitboxIdentity Hitbox { get; }
Property Value
- HitboxIdentity
HitregModule
Gets the firearm hitreg module responsible for the shot.
public HitscanHitregModuleBase HitregModule { get; }
Property Value
- HitscanHitregModuleBase
Item
Gets the Item triggering the event.
public Item Item { get; }
Property Value
Player
Gets the player who fired the shot.
public Player Player { get; }
Property Value
Position
Gets the position of the hit.
public Vector3 Position { get; }
Property Value
- Vector3
RaycastHit
Gets the raycast info.
public RaycastHit RaycastHit { get; }
Property Value
- RaycastHit
Target
Gets the target player. Can be null.
public Player Target { get; }