CyberTrashCan

┗> Event > Object > Class


A Cyber Trash Can that can contain either an Item or some money.
CyberTrashCan is an Event - naming an object cybertrash on an objects layer in a map creates this object.
See this object's Fields for the configurable properties on this object.


Constructor


CyberTrashCan(x: number, y: number, properties: number)

Arguments:

x: number
y: number
properties: number




Methods




CyberTrashCan:onAdd(parent: Event|World)

Handles making the trashcan remain appearing open when re-entering the room

Arguments:

parent: Event|World

The World Object manages everything relating to the overworld in Kristal.
A globally available instance of World is stored in Game.world.



CyberTrashCan:onInteract(player: Player, dir: string)

Handles opening the trashcan and giving the player their items

Arguments:

player: Player

The character controlled by the player when in the Overworld.

dir: string

Returns:

1: boolean



Fields


CyberTrashCan.item: string

[Property item] The name of the item contianed in this treasure chest - cannot be used in conjunction with money


CyberTrashCan.money: number

[Property money] The amount of money contained in this treasure chest - cannot be used in conjunction with item


CyberTrashCan.set_flag: string

[Property setflag] An optional flag to set when the treasure chest is opened


CyberTrashCan.set_value: any

[Property setvalue] The value to set on the flag specified by setflag (Defaults to true)