Module ...
Handles actors stats
Functions
| _M:addObject (inven_id, o) | Adds an object to an inventory |
| _M:canWearObject (o) | Can we wear this item? |
| _M:defineInventory (short_name, name, is_worn, desc) | Defines stats Static! |
| _M:dropFloor (inven, item, vocal, all) | Drop an object on the floor |
| _M:findInAllInventories (name, getname) | Finds an object by name in all the actor's inventories |
| _M:findInInventory (inven, name, getname) | Finds an object by name in an inventory |
| _M:getInven (id) | Returns the content of an inventory as a table |
| _M:init (t) | Initialises inventories with default values if needed |
| _M:onAddObject (o) | Called upon adding an object |
| _M:onRemoveObject (o) | Called upon removing an object |
| _M:onTakeoff (o) | Call when an object is taken off |
| _M:onWear (o) | Call when an object is worn |
| _M:pickupFloor (i, vocal) | Picks an object from the floor |
| _M:removeObject (inven, item, no_unstack) | Removes an object from inventory |
| _M:showEquipInven (title, filter, action, allow_keybind, inven) | Show combined equipment/inventory dialog |
| _M:showEquipment (title, filter, action, allow_keybind) | Show equipment dialog |
| _M:showInventory (title, inven, filter, action, allow_keybind) | Show inventory dialog |
| _M:showPickupFloor (title, filter, action) | Show floor pickup dialog |
| _M:sortInven (inven) | Re-order inventory, sorting and stacking it |
| _M:takeoffObject (inven, item) | Takeoff item |
| _M:wearObject (o, replace, vocal) | Wear/wield an item |
Functions
- _M:addObject (inven_id, o)
-
Adds an object to an inventory
Parameters
- inven_id:
- o:
Return value:
false if the object could not be added - _M:canWearObject (o)
-
Can we wear this item?
Parameters
- o:
- _M:defineInventory (short_name, name, is_worn, desc)
-
Defines stats Static!
Parameters
- short_name:
- name:
- is_worn:
- desc:
- _M:dropFloor (inven, item, vocal, all)
-
Drop an object on the floor
Parameters
- inven: the inventory to drop from
- item: the item id to drop
- vocal:
- all:
Return value:
the object removed or nil if no item existed - _M:findInAllInventories (name, getname)
-
Finds an object by name in all the actor's inventories
Parameters
- name: the name to look for
- getname: the parameters to pass to getName(), if nil the default is {no_count=true, force_id=true}
- _M:findInInventory (inven, name, getname)
-
Finds an object by name in an inventory
Parameters
- inven: the inventory to look into
- name: the name to look for
- getname: the parameters to pass to getName(), if nil the default is {no_count=true, force_id=true}
- _M:getInven (id)
-
Returns the content of an inventory as a table
Parameters
- id:
- _M:init (t)
-
Initialises inventories with default values if needed
Parameters
- t:
- _M:onAddObject (o)
-
Called upon adding an object
Parameters
- o:
- _M:onRemoveObject (o)
-
Called upon removing an object
Parameters
- o:
- _M:onTakeoff (o)
-
Call when an object is taken off
Parameters
- o:
- _M:onWear (o)
-
Call when an object is worn
Parameters
- o:
- _M:pickupFloor (i, vocal)
-
Picks an object from the floor
Parameters
- i:
- vocal:
- _M:removeObject (inven, item, no_unstack)
-
Removes an object from inventory
Parameters
- inven: the inventory to drop from
- item: the item id to drop
- no_unstack: if the item was a stack takes off the whole stack if true
Return value:
the object removed or nil if no item existed - _M:showEquipInven (title, filter, action, allow_keybind, inven)
-
Show combined equipment/inventory dialog
Parameters
- title:
- filter: nil or a function that filters the objects to list
- action: a function called when an object is selected
- allow_keybind:
- inven: the inventory (from self:getInven())
- _M:showEquipment (title, filter, action, allow_keybind)
-
Show equipment dialog
Parameters
- title:
- filter: nil or a function that filters the objects to list
- action: a function called when an object is selected
- allow_keybind:
- _M:showInventory (title, inven, filter, action, allow_keybind)
-
Show inventory dialog
Parameters
- title:
- inven: the inventory (from self:getInven())
- filter: nil or a function that filters the objects to list
- action: a function called when an object is selected
- allow_keybind:
- _M:showPickupFloor (title, filter, action)
-
Show floor pickup dialog
Parameters
- title:
- filter: nil or a function that filters the objects to list
- action: a function called when an object is selected
- _M:sortInven (inven)
-
Re-order inventory, sorting and stacking it
Parameters
- inven:
- _M:takeoffObject (inven, item)
-
Takeoff item
Parameters
- inven:
- item:
- _M:wearObject (o, replace, vocal)
-
Wear/wield an item
Parameters
- o:
- replace:
- vocal: