extends Reference

const NAME = "broken"

var ctx = null

func _init():
	pass

func enter_from(state):
	ctx.remove_from_group("damageable")
	ctx.get_node("item_dump").enabled = true
	ctx.get_node("item_dump").reset()
	ctx.get_node("coin_machine").enabled = false
	ctx.get_node("%item_holder").add_enabled = false
	ctx.get_node("%item_holder").remove_enabled = false
	ctx.get_node("status_light").fail()

func exit_to(state):
	assert(state.NAME != "broken")
	ctx.add_to_group("damageable")

func on_coin_machine_coin_requirement_met(player):
	assert(false, "should be impossible while broken")

func on_cook_timer_timeout():
	assert(false, "should be impossible while broken")

func on_item_holder_item_changed(item):
	assert(false, "should be impossible while broken")

func on_item_dump_completed():
	ctx.change_state(ctx.StateIdle.new())

func take_damage():
	pass # already broken
