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