From 15a1d2a66e48324e1d560dc13b776627820f3999 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Sun, 27 Oct 2024 15:52:48 +0100 Subject: next commit --- Effects/burn_effect.gd | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'Effects/burn_effect.gd') diff --git a/Effects/burn_effect.gd b/Effects/burn_effect.gd index 9693292..cf7f26a 100644 --- a/Effects/burn_effect.gd +++ b/Effects/burn_effect.gd @@ -3,17 +3,22 @@ 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 - set_duration(5.0) + 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 - 5) + 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 -- cgit v1.2.3