summaryrefslogtreecommitdiff
path: root/Effects/burn_effect.gd
blob: 96932926035a1e7bdbfa1efa0d34e8ed0b9013ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
extends Effect


@onready var unit: Unit = get_parent()

var base_modulate: Color


func _ready():
	base_modulate = unit.get_node("Sprite2D").self_modulate
	
	set_duration(5.0)
	
	set_tick(1.0)
	tick_finished.connect(func():
		unit.set_hp(unit.hp - 5)
		unit.get_node("Sprite2D").self_modulate = Color(1, 0, 0)
		await get_tree().create_timer(0.1).timeout
		unit.get_node("Sprite2D").self_modulate = base_modulate
	)