Zoom, nouvelles mutations et cie

* ajout d'une aide de jeu directement dans l'interface
* ajout de 8 nouvelles mutations (Productif, pressé, pur, vivace, généreux, robuste, protecteur et prolifique)
* changements d'icône pour plus de clarté
* changement de l'animation de recharge pour montrer le temps qui passe
* ajout des mutations rare et de la possibilité d'avoir des mutation niveau 2 dès le départ
* ajout d'un zoom
* correction de bugs (déplacement au dialogue, problème de score au load d'une région)
This commit is contained in:
2026-03-20 17:16:56 +01:00
parent 76707171fa
commit 4b16d52740
52 changed files with 1217 additions and 272 deletions

View File

@@ -7,6 +7,8 @@ const SHOVEL_ICON = preload("res://common/icons/shovel.svg")
const GROWING_ICON = preload("res://common/icons/chevrons-up.svg")
const SCORE_ICON = preload("res://common/icons/growth.svg")
const RARITY_POOL : Array[int] = [0,0,0,0,0,0,0,1,1,1]
@export var plant_name : String
@export var plant_archetype: PlantArchetype
@export var plant_mutations: Array[PlantMutation]
@@ -39,12 +41,11 @@ static func generate_from_parent(plant_data : PlantData) -> Seed:
static func generate_random() -> Seed:
var archetype = PlantArchetype.get_random()
var random_mutations : Array[PlantMutation] = []
random_mutations.append(archetype.available_mutations.pick_random().duplicate_deep())
var new_seed = Seed.new(
Random.generate_random_word(),
PlantArchetype.get_random(),
random_mutations
[generate_first_mutation(archetype)]
)
return new_seed
@@ -141,6 +142,19 @@ func get_particles() -> Array[EffectParticles.Parameters]:
return param
static func generate_first_mutation(archetype : PlantArchetype) -> PlantMutation:
var rarity : int = RARITY_POOL.pick_random()
var possible_mutation : PlantMutation = archetype.available_mutations.filter(
func (m : PlantMutation): return m.get_base_rarity() <= rarity
).pick_random().duplicate_deep()
var level_to_add = rarity - possible_mutation.get_base_rarity()
possible_mutation.level += level_to_add
return possible_mutation
static func mutate_mutations(parent : PlantData) -> Array[PlantMutation]:
var mutation_possibility : Array[MutationPossibility] = [
@@ -152,13 +166,11 @@ static func mutate_mutations(parent : PlantData) -> Array[PlantMutation]:
):
mutation_possibility = [
UpgradeMutation.new(),
RemoveMutation.new(),
]
elif len(parent.mutations) > 0:
mutation_possibility = [
AddMutation.new(),
UpgradeMutation.new(),
RemoveMutation.new(),
]
var chosen_mutation_possibility = mutation_possibility.pick_random()

View File

@@ -7,6 +7,7 @@ const PARTICLES_DISTANCE = 100
const DEFAULT_ICON = preload("res://common/icons/north-star.svg")
const ENERGY_ICON = preload("res://common/icons/bolt.svg")
const DOOR_ICON = preload("res://common/icons/logout.svg")
const PLANT_ICON = preload("res://common/icons/seedling.svg")
var started_time = 0.
var signals : Array[DetectorSignalIndividual] = []
@@ -30,6 +31,13 @@ func _init(region : Region, pos : Vector2):
DOOR_ICON
)
)
if e is Plant:
signals.append(
DetectorSignalIndividual.new(
(pos - e.global_position).normalized().angle(),
PLANT_ICON
)
)
func _draw():
if started_time < SIGNAL_DURATION: