kalevala v0.1.0 Kalevala.World.Room.Callbacks protocol View Source
Link to this section Summary
Functions
Callback for confirming or aborting character movement
Callback for when a new event is received
Load the exits for a given room
Called when the room is initializing
Called after the room process is started
Callback for allowing an item drop off
Callback for allowing an item pick up
Convert item instances into items
Callback for the room to hook into movement between exits
Link to this section Types
Link to this section Functions
Callback for confirming or aborting character movement
Called while the Zone is checking each side of the exit to know if the movement is indeed allowed. Returning the original event allows movement to proceed, otherwise return an aborted event to prevent movement.
Hook to allow for the room to reject movement for custom reasons, e.g. an NPC is blocking the exit and needs to be convinced first, or there is a trap blocking the exit.
Callback for when a new event is received
Load the exits for a given room
Used when a character is trying to move, the appropriate exit is chosen and forwarded into movement request callbacks. Since this is a common thing that will happen 99% of the time, Kalevala handles it.
Called when the room is initializing
Called after the room process is started
Directly after init
is completed.
item_request_drop(room, context, item_request_drop, item_instance)
View SourceCallback for allowing an item drop off
A character is requesting to pick up an item, this let's the room accept or reject the request.
item_request_pickup(room, context, item_request_pickup, item_instance)
View SourceCallback for allowing an item pick up
A character is requesting to pick up an item, this let's the room accept or reject the request.
Convert item instances into items
Callback for the room to hook into movement between exits
The character is requesting to move via an exit, a tuple allowing or rejecting the movement before being pitched up to the Zone should be returned.
Can immediately terminate a room before being checked in a more detailed fashion
with confirm_movement/2
below.