diff --git a/files/data/scripts/omw/combat/interface.lua b/files/data/scripts/omw/combat/interface.lua index c9790fcda4..08510c0fe9 100644 --- a/files/data/scripts/omw/combat/interface.lua +++ b/files/data/scripts/omw/combat/interface.lua @@ -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 = {