extends Node2D

onready var global: Node = get_node("/root/Global")

func _on_Gramophone_item_used(item_id):
	var inv = global.inventory
	if item_id == inv.Items.vynil:
		if inv.remove_item(item_id):
			var anim: AnimationPlayer = global.player.animation_player
			anim.play("Victory")
			global.game_vars["vynil_used"] = true


func _on_Chest_item_used(item_id):
	var inv = global.inventory
	if item_id == inv.Items.crystal:
		if inv.remove_item(item_id):
			var anim: AnimationPlayer = global.player.animation_player
			anim.play("Victory")
			global.game_vars["crystal_used"] = true


func _on_Entrance_used():
	if !global.game_vars.has("rec_cartridge_used"):
		global.change_music("main")

