Show / Hide Table of Contents

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
System.Object
MeleeHitEvent
Namespace: Content.Shared.Weapons.Melee.Events
Assembly: Content.Shared.dll
Syntax
public sealed class MeleeHitEvent : HandledEntityEventArgs

Constructors

| Improve this Doc View Source

MeleeHitEvent(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 Source

BaseDamage

The base amount of damage dealt by the melee hit.

Declaration
public readonly DamageSpecifier BaseDamage
Field Value
Type Description
DamageSpecifier
| Improve this Doc View Source

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.

| Improve this Doc View Source

HitEntities

A list containing every hit entity. Can be zero.

Declaration
public IReadOnlyList<EntityUid> HitEntities
Field Value
Type Description
IReadOnlyList<EntityUid>
| Improve this Doc View Source

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
| Improve this Doc View Source

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.

| Improve this Doc View Source

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>
| Improve this Doc View Source

User

The user who attacked with the melee weapon.

Declaration
public readonly EntityUid User
Field Value
Type Description
EntityUid
| Improve this Doc View Source

Weapon

The melee weapon used.

Declaration
public readonly EntityUid Weapon
Field Value
Type Description
EntityUid
  • Improve this Doc
  • View Source
☀
☾
In This Article
Back to top
Generated by DocFX
☀
☾