summaryrefslogtreecommitdiff
path: root/Effects
diff options
context:
space:
mode:
authorDaniel Weipert <git@mail.dweipert.de>2024-10-27 15:52:48 +0100
committerDaniel Weipert <git@mail.dweipert.de>2024-10-27 15:52:48 +0100
commit15a1d2a66e48324e1d560dc13b776627820f3999 (patch)
tree4c062545a4c1a750293b52d5c11258f9b4218a2a /Effects
parenta495681453c97578cc4a408d6919c6879524a603 (diff)
next commit
Diffstat (limited to 'Effects')
-rw-r--r--Effects/SlowEffect.gd8
-rw-r--r--Effects/burn_effect.gd9
2 files changed, 13 insertions, 4 deletions
diff --git a/Effects/SlowEffect.gd b/Effects/SlowEffect.gd
index a3070ca..a995b7e 100644
--- a/Effects/SlowEffect.gd
+++ b/Effects/SlowEffect.gd
@@ -3,17 +3,21 @@ extends Effect
@onready var unit: Unit = get_parent()
+var level := 1
+
var base_speed: float
-var magnitude: float = 0.5 :
+var magnitude: float:
set(value):
magnitude = clamp(value, 0.0, 1.0)
func _ready():
+ magnitude = 0.1 * level
+
add()
- set_duration(5.0)
+ set_duration(5.0 + ((level - 1) * 0.1))
duration_finished.connect(func():
remove()
)
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