14 lines
444 B
GDScript
14 lines
444 B
GDScript
extends ActiveAbility
|
|
|
|
@export var speed_bonus: float = 2.0
|
|
@export var acceleration_time: float = 0.3
|
|
|
|
func unavailable_reason(ship: CharacterBody2D) -> String:
|
|
if ship.call("is_boosting"):
|
|
return "Dopalacz już działa"
|
|
return "Wymagana pełna energia" if ship.get("energy") < ship.get("max_energy") else ""
|
|
|
|
func activate(ship: CharacterBody2D) -> void:
|
|
ship.set("energy", 0.0)
|
|
ship.call("start_boost", speed_bonus, acceleration_time)
|