PVP/Objects/plant.gd
2026-03-24 19:40:21 +01:00

33 lines
558 B
GDScript

extends Battler
class_name Plant
var level : int = 1:
set(value):
level = value
apply_progression()
@export var xp_curve : Curve
var xp_points = 0 :
set(value):
xp_points = value
print(xp_curve.sample(level))
if xp_points >= xp_curve.sample(level):
level +=1
func get_new_target() -> void:
super()
if not target:
return
target = target as Trash
target.trash_cleaned.connect(_on_Trash_trash_cleaned)
func apply_progression() -> void:
life += 10
damage += 2
func _on_Trash_trash_cleaned(xp_worth)-> void:
xp_points += xp_worth