Class MeleeHitEvent
Raised directed on the melee weapon entity used to attack something in combat mode, whether through a click attack or wide attack.
Inheritance
Namespace: Content.Shared.Weapons.Melee.Events
Assembly: Content.Shared.dll
Syntax
public sealed class MeleeHitEvent : HandledEntityEventArgs
Constructors
| Improve this Doc View SourceMeleeHitEvent(List<EntityUid>, EntityUid, EntityUid, DamageSpecifier)
Declaration
public MeleeHitEvent(List<EntityUid> hitEntities, EntityUid user, EntityUid weapon, DamageSpecifier baseDamage)
Parameters
Type | Name | Description |
---|---|---|
List<EntityUid> | hitEntities | |
EntityUid | user | |
EntityUid | weapon | |
DamageSpecifier | baseDamage |
Fields
| Improve this Doc View SourceBaseDamage
The base amount of damage dealt by the melee hit.
Declaration
public readonly DamageSpecifier BaseDamage
Field Value
Type | Description |
---|---|
DamageSpecifier |
BonusDamage
Damage to add to the default melee weapon damage. Applied before modifiers.
Declaration
public DamageSpecifier BonusDamage
Field Value
Type | Description |
---|---|
DamageSpecifier |
Remarks
This might be required as damage modifier sets cannot add a new damage type to a DamageSpecifier.
HitEntities
A list containing every hit entity. Can be zero.
Declaration
public IReadOnlyList<EntityUid> HitEntities
Field Value
Type | Description |
---|---|
IReadOnlyList<EntityUid> |
HitSoundOverride
Used to define a new hit sound in case you want to override the default GenericHit. Also gets a pitch modifier added to it.
Declaration
public SoundSpecifier HitSoundOverride
Field Value
Type | Description |
---|---|
Robust.Shared.Audio.SoundSpecifier |
IsHit
Check if this is true before attempting to do something during a melee attack other than changing/adding bonus damage.
For example, do not spend charges unless IsHit equals true.
Declaration
public bool IsHit
Field Value
Type | Description |
---|---|
System.Boolean |
Remarks
Examining melee weapons calls this event, but with IsHit set to false.
ModifiersList
Modifier sets to apply to the hit event when it's all said and done. This should be modified by adding a new entry to the list.
Declaration
public List<DamageModifierSet> ModifiersList
Field Value
Type | Description |
---|---|
List<DamageModifierSet> |
User
The user who attacked with the melee weapon.
Declaration
public readonly EntityUid User
Field Value
Type | Description |
---|---|
EntityUid |
Weapon
The melee weapon used.
Declaration
public readonly EntityUid Weapon
Field Value
Type | Description |
---|---|
EntityUid |