46 lines
904 B
GDScript

extends Reference
const NAME = "blocked"
var ctx = null
var label : String = "Blocked!"
func _init(block_string : String):
label = block_string
func enter_from(state):
ctx.progress_text.text = label
ctx.coin_machine.enabled = false
ctx.item_dump.enabled = false
ctx.item_holder.add_enabled = true
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):
pass
func on_item_holder_item_changed(item):
if item == null:
ctx.change_state(ctx.States[ctx.EState.IDLE].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())