Fix onhit attack type docs enum

This commit is contained in:
Mads Buvik Sandvei
2026-03-30 14:10:24 +00:00
committed by jvoisin
parent 3ddd1a1371
commit 636ac1908d
+16 -1
View File
@@ -12,13 +12,20 @@ local onHitHandlers = {}
-- @field #string Ranged
-- @field #string Unspecified
---
-- Table of possible attack types
-- @type AttackType
-- @field #number Chop
-- @field #number Slash
-- @field #number Thrust
---
-- @type AttackInfo
-- @field [parent=#AttackInfo] #table damage A table mapping a stat name (health, fatigue, or magicka) to a number. For example, {health = 50, fatigue = 10} will cause 50 damage to health and 10 to fatigue (before adjusting for armor and difficulty). This field is ignored for failed attacks.
-- @field [parent=#AttackInfo] #number strength A number between 0 and 1 representing the attack strength. This field is ignored for failed attacks.
-- @field [parent=#AttackInfo] #boolean successful Whether the attack was successful or not.
-- @field [parent=#AttackInfo] #AttackSourceType sourceType What class of attack this is.
-- @field [parent=#AttackInfo] openmw.self#ATTACK_TYPE type (Optional) Attack variant if applicable. For melee attacks this represents chop vs thrust vs slash. For unarmed creatures this implies which of its 3 possible attacks were used. For other attacks this field can be ignored.
-- @field [parent=#AttackInfo] #AttackType type (Optional) Attack variant if applicable. For melee attacks this represents chop vs thrust vs slash. For unarmed creatures this implies which of its 3 possible attacks were used. For other attacks this field can be ignored.
-- @field [parent=#AttackInfo] openmw.types#Actor attacker (Optional) Attacking actor
-- @field [parent=#AttackInfo] openmw.types#Weapon weapon (Optional) Attacking weapon
-- @field [parent=#AttackInfo] #string ammo (Optional) Ammo record ID
@@ -137,6 +144,14 @@ return {
Ranged = 'ranged',
Unspecified = 'unspecified',
}),
--- @{#AttackType}
-- @field [parent=#Combat] #AttackType ATTACK_TYPES Available attack types
ATTACK_TYPES = util.makeStrictReadOnly({
Chop = 0,
Slash = 1,
Thrust = 2,
}),
},
eventHandlers = {