Weapon
Part of openmw.types
Usage:
local Weapon = require('openmw.types').Weapon
Type types
| types.Weapon |
#Weapon functions |
Type Weapon
| Weapon.TYPE | |
| Weapon.baseType | |
| Weapon.createRecordDraft(weapon) |
Creates a #WeaponRecord without adding it to the world database. |
| Weapon.objectIsInstance(object) |
Whether the object is a Weapon. |
| Weapon.record(objectOrRecordId) |
Returns the read-only #WeaponRecord of a weapon |
| Weapon.records |
A read-only list of all #WeaponRecords in the world database. |
Type WeaponRecord
| WeaponRecord.chopMaxDamage | |
| WeaponRecord.chopMinDamage | |
| WeaponRecord.enchant | |
| WeaponRecord.enchantCapacity | |
| WeaponRecord.health | |
| WeaponRecord.icon |
VFS path to the icon |
| WeaponRecord.id |
Record id |
| WeaponRecord.isMagical | |
| WeaponRecord.isSilver | |
| WeaponRecord.model |
VFS path to the model |
| WeaponRecord.mwscript |
MWScript on this weapon (can be empty) |
| WeaponRecord.name |
Human-readable name |
| WeaponRecord.reach | |
| WeaponRecord.slashMaxDamage | |
| WeaponRecord.slashMinDamage | |
| WeaponRecord.speed | |
| WeaponRecord.thrustMaxDamage | |
| WeaponRecord.thrustMinDamage | |
| WeaponRecord.type |
See Weapon.TYPE |
| WeaponRecord.value | |
| WeaponRecord.weight |
Type WeaponTYPE
Type types
Field(s)
- #Weapon types.Weapon
-
#Weapon functions
Type Item
Type Weapon
Extends #Item
Weapon functions
Field(s)
- Weapon.createRecordDraft(weapon)
-
Creates a #WeaponRecord without adding it to the world database.
Use openmw_world#world.createRecord to add the record to the world.
Parameter
-
#WeaponRecord weapon: A Lua table with the fields of a WeaponRecord.
Return value
#WeaponRecord: A strongly typed Weapon record.
-
- Weapon.objectIsInstance(object)
-
Whether the object is a Weapon.
Parameter
-
openmw.core#GameObject object:
Return value
#boolean:
-
- Weapon.record(objectOrRecordId)
-
Returns the read-only #WeaponRecord of a weapon
Parameter
-
#any objectOrRecordId:
Return value
-
- #list<#WeaponRecord> Weapon.records
-
A read-only list of all #WeaponRecords in the world database.
Type WeaponRecord
Field(s)
- #number WeaponRecord.chopMaxDamage
- #number WeaponRecord.chopMinDamage
- #string WeaponRecord.enchant
- #number WeaponRecord.enchantCapacity
- #number WeaponRecord.health
- #string WeaponRecord.icon
-
VFS path to the icon
- #string WeaponRecord.id
-
Record id
- #boolean WeaponRecord.isMagical
- #boolean WeaponRecord.isSilver
- #string WeaponRecord.model
-
VFS path to the model
- #string WeaponRecord.mwscript
-
MWScript on this weapon (can be empty)
- #string WeaponRecord.name
-
Human-readable name
- #number WeaponRecord.reach
- #number WeaponRecord.slashMaxDamage
- #number WeaponRecord.slashMinDamage
- #number WeaponRecord.speed
- #number WeaponRecord.thrustMaxDamage
- #number WeaponRecord.thrustMinDamage
- #number WeaponRecord.type
-
See Weapon.TYPE
- #number WeaponRecord.value
- #number WeaponRecord.weight
Type WeaponTYPE
Weapon.TYPE
Field(s)
- #number WeaponTYPE.Arrow
- #number WeaponTYPE.AxeOneHand
- #number WeaponTYPE.AxeTwoHand
- #number WeaponTYPE.BluntOneHand
- #number WeaponTYPE.BluntTwoClose
- #number WeaponTYPE.BluntTwoWide
- #number WeaponTYPE.Bolt
- #number WeaponTYPE.LongBladeOneHand
- #number WeaponTYPE.LongBladeTwoHand
- #number WeaponTYPE.MarksmanBow
- #number WeaponTYPE.MarksmanCrossbow
- #number WeaponTYPE.MarksmanThrown
- #number WeaponTYPE.ShortBladeOneHand
- #number WeaponTYPE.SpearTwoWide