Show pagesourceOld revisionsBacklinksBack to top Share via Share via... Twitter LinkedIn Facebook Pinterest Telegram WhatsApp Yammer Reddit TeamsRecent ChangesSend via e-MailPrintPermalink × Table of Contents Salet character CoffeeScript properties inventory CoffeeScript methods take drop has inv listinv Salet character The character object is available as salet.character. It controls the character's inventory. On loading the game, Salet creates a new Character object automatically and erases the old values. On saving the game, Salet saves every value in salet.character that can be serialized (turned into text). CoffeeScript properties inventory An array of units - character inventory. Better not call it directly, there are methods for that. CoffeeScript methods take Adds a new unit to the character inventory (at the end) Argument: a unit, SaletUnit class drop Removes from the inventory a unit with given name. Returns true if the deletion was successfull; false if the unit is not found. Argument: name of the unit (<unit>.name), string. Mandatory argument. has Returns true if the character inventory has a unit with this name; false if it's not found. Argument: name of the unit (<unit>.name), string. Mandatory argument. inv Calls an inv action of the given unit. An action can be a function or a string. Argument: name of the unit (<unit>.name), string. Mandatory argument. listinv Returns a link in the form of <a href="{unit.name}">{unit.display}</a>. The link text is a display property. When clicked on it, Salet will call the inv action of this unit. Argument: name of the unit (<unit>.name), string. Mandatory argument. api en/api/character.txt Last modified: 2021/01/24 10:42by 127.0.0.1