TreasureChest
┗> Event > Object > Class
A Treasure Chest that can contain either an Item or some money.
TreasureChest
is an Event
- naming an object chest
on an objects
layer in a map creates this object.
See this object's Fields for the configurable properties on this object.
Methods
TreasureChest:onAdd(parent: any)
Handles making the chest remain appearing open when re-entering the room
Arguments:
parent: any |
TreasureChest:onInteract(player: any, dir: any)
Handles opening the chest and giving the player their items
Arguments:
player: any | |
dir: any |
Returns:
1: boolean |
Fields
TreasureChest.item: string
[Property item
] The name of the item contianed in this treasure chest - cannot be used in conjunction with money
TreasureChest.money: number
[Property money
] The amount of money contained in this treasure chest - cannot be used in conjunction with item
TreasureChest.set_flag: string
[Property setflag
] An optional flag to set when the treasure chest is opened
TreasureChest.set_value: any
[Property setvalue
] The value to set on the flag specified by setflag
(Defaults to true
)