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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user