#39 ajout d'un compost plus des ajouts mineurs de qualité de vie

This commit is contained in:
2025-08-20 15:41:27 +02:00
parent 219e8258e7
commit 2f0c5a2be4
15 changed files with 454 additions and 17 deletions

View File

@@ -0,0 +1,34 @@
extends Interactable
class_name Compost
@export var value_per_seed : float = 0.5
var fill_value : float = 0.
func _process(_delta):
%ProgressBar.value = lerp(%ProgressBar.value, fill_value * 100, 0.5)
func _ready():
fill_value = 0.
func can_interact(p : Player) -> bool:
return p.inventory.get_item() and p.inventory.get_item() is Seed
func requirement_text() -> String:
return "You must have a seed in hand"
func interact(p : Player) -> bool:
if not can_interact(p):
return false
p.delete_item()
fill_value += value_per_seed
if fill_value >= 1.:
$AnimationPlayer.play("empty")
fill_value = 0
p.upgrade()
value_per_seed /= 1.5
else:
$AnimationPlayer.play("fill")
return true

View File

@@ -0,0 +1 @@
uid://dw6jgsasb2fe1