blob: 622a97e62bfeffc86782953225b3af0b389e1c5f (
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
26
27
28
29
30
31
32
33
|
extends Effect
@onready var unit: Unit = get_parent()
var level := 1
var base_speed: float
var magnitude: float:
set(value):
magnitude = clamp(value, 0.0, 1.0)
func _ready():
magnitude = 0.1 * level
add()
set_duration(5.0 + ((level - 1) * 0.1))
duration_finished.connect(func():
remove()
)
func add():
unit.sprite.self_modulate = Color(0, 0, 1)
unit.speed -= unit.base_speed * magnitude
func remove():
unit.sprite.self_modulate = Color(1, 1, 1)
unit.speed += unit.base_speed * magnitude
|