ajout des mutation et refonte de l'inspecteur

* ajout des mutations #86
* changement de l'objectif #85
* refonte de l'inspecteur #71
* changement léger de la plantation
* les plantes ne donnent que des graines de leurs espèces
* refonte partielle du code, refacto
This commit is contained in:
2025-10-12 01:03:08 +02:00
parent bb24efe46b
commit ef392595de
108 changed files with 1921 additions and 477 deletions

View File

@@ -2,7 +2,9 @@ extends Node2D
class_name PlantSprite
const PLANTED_SEED_CROP_WIDTH = 50
const PLANTED_SEED_POS_Y = -50
const PLANTED_SEED_POS_Y = 0
const PARTICLES_SCENE : PackedScene = preload("res://common/vfx/particles/particles.tscn")
signal harvest_animation_finished
@@ -35,6 +37,16 @@ func get_state_texture(s: Plant.State, plant_type : PlantType) -> Texture2D:
return plant_type.mature_texture
return null
func generate_mutation_effects(plant : Plant):
for m in plant.plant_mutations:
var particles_emitter : Particles = PARTICLES_SCENE.instantiate() as CPUParticles2D
particles_emitter.setup_particles(
Particles.Parameters.new(
m.get_icon(),
PlantMutation.get_rarity_color(m)
)
)
add_child(particles_emitter)
func start_harvest_animation():
$AnimationPlayer.play("harvest")