managems/entities/mana_counter.gd

21 lines
516 B
GDScript

extends Control
export(Gem.Type) var type = Gem.Type.Thermic
export(Gem.Effect) var effect = Gem.Effect.ManaNegative
var count: int = 0
# Called when the node enters the scene tree for the first time.
func _ready():
$Gem.type = type
$Gem.effect = effect
$Gem.update_sprite()
$Label.text = str(count)
func update_count(matched: Dictionary):
for k in matched.keys():
if (k[0] == type) and (k[1] == effect):
count += matched[k]
break
$Label.text = str(count)