blob: cf7f26a3435a0d568cf4b407f85765bfbe3354ef (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
extends Effect
@onready var unit: Unit = get_parent()
var level := 1
var power := 0.0
var base_modulate: Color
func _ready():
base_modulate = unit.get_node("Sprite2D").self_modulate
power = 5.0 + (level - 1)
set_duration(5.0 + ((level - 1) * 0.1))
set_tick(1.0)
tick_finished.connect(func():
unit.set_hp(unit.hp - power)
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
)
|