27 lines
651 B
GDScript
27 lines
651 B
GDScript
extends Reference
|
|
|
|
const NAME = "idle"
|
|
|
|
var ctx = null
|
|
|
|
func _init():
|
|
pass
|
|
|
|
func enter_from(state):
|
|
ctx.get_node("coin_machine").enabled = false
|
|
ctx.get_node("%item_holder").add_enabled = true
|
|
ctx.get_node("%item_holder").remove_enabled = false # not possible
|
|
|
|
func exit_to(state):
|
|
pass
|
|
|
|
func on_coin_machine_coin_requirement_met(player):
|
|
assert(false, "coin machine should be disabled while idle")
|
|
|
|
func on_cook_timer_timeout():
|
|
assert(false, "cook timer shouldn't trigger while idle")
|
|
|
|
func on_item_holder_item_changed(item):
|
|
assert(item != null, "there should be no item to remove while idle")
|
|
ctx.change_state(ctx.StateHoldingItem.new())
|