summaryrefslogtreecommitdiff
path: root/Effects
diff options
context:
space:
mode:
authorDaniel Weipert <git@mail.dweipert.de>2024-11-05 11:34:49 +0100
committerDaniel Weipert <git@mail.dweipert.de>2024-11-05 11:34:49 +0100
commitc8f674ac6fa0914d9e448d2929f2385cdad80d60 (patch)
treea913454c42bb520aa644f4e2dcf0d42ba11c83de /Effects
parent84365b6f901a9c0251a9f724a8d9f81a3787e97d (diff)
next commit
Diffstat (limited to 'Effects')
-rw-r--r--Effects/SlowEffect.gd4
-rw-r--r--Effects/burn_effect.gd7
2 files changed, 5 insertions, 6 deletions
diff --git a/Effects/SlowEffect.gd b/Effects/SlowEffect.gd
index a995b7e..622a97e 100644
--- a/Effects/SlowEffect.gd
+++ b/Effects/SlowEffect.gd
@@ -24,10 +24,10 @@ func _ready():
func add():
- unit.get_node("Sprite2D").self_modulate = Color(0, 0, 1)
+ unit.sprite.self_modulate = Color(0, 0, 1)
unit.speed -= unit.base_speed * magnitude
func remove():
- unit.get_node("Sprite2D").self_modulate = Color(1, 1, 1)
+ unit.sprite.self_modulate = Color(1, 1, 1)
unit.speed += unit.base_speed * magnitude
diff --git a/Effects/burn_effect.gd b/Effects/burn_effect.gd
index cf7f26a..2e8bf7d 100644
--- a/Effects/burn_effect.gd
+++ b/Effects/burn_effect.gd
@@ -10,16 +10,15 @@ 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():
+ base_modulate = unit.sprite.self_modulate
unit.set_hp(unit.hp - power)
- unit.get_node("Sprite2D").self_modulate = Color(1, 0, 0)
+ unit.sprite.self_modulate = Color(1, 0, 0)
await get_tree().create_timer(0.1).timeout
- unit.get_node("Sprite2D").self_modulate = base_modulate
+ unit.sprite.self_modulate = base_modulate
)