43 lines
862 B
GDScript
43 lines
862 B
GDScript
extends Reference
|
|
|
|
const NAME = "blocked"
|
|
|
|
var ctx = null
|
|
|
|
func _init():
|
|
pass
|
|
|
|
func enter_from(state):
|
|
ctx.progress_text.text = "Blocked!"
|
|
ctx.coin_machine.enabled = false
|
|
ctx.item_dump.enabled = false
|
|
for item_slot in ctx.item_slots:
|
|
item_slot.add_enabled = true
|
|
item_slot.remove_enabled = true
|
|
ctx.status_light.warn()
|
|
|
|
func exit_to(state):
|
|
pass
|
|
|
|
func update(delta):
|
|
pass
|
|
|
|
func on_coin_machine_coin_requirement_met(player):
|
|
assert(false)
|
|
|
|
func on_gen_timer_timeout():
|
|
assert(false)
|
|
|
|
func on_slot_item_changed(item):
|
|
if ctx.items_in_slots.size() < 2:
|
|
ctx.change_state(ctx.States[ctx.EState.IDLE].new())
|
|
elif ctx.item_to_craft != null:
|
|
ctx.change_state(ctx.States[ctx.EState.READY].new())
|
|
|
|
func on_item_dump_item_dump_completed():
|
|
pass
|
|
|
|
func on_damage_taken():
|
|
if ctx.current_hp <= 0:
|
|
ctx.change_state(ctx.States[ctx.EState.BROKEN].new())
|