Ajout d'un mode infini
This commit is contained in:
@@ -35,15 +35,14 @@ func update_model():
|
||||
func unlock_mutation():
|
||||
var progression = GameInfo.game_data.progression_data
|
||||
|
||||
if progression.mutations_unlocked < len(progression.get_all_mutations()):
|
||||
var new_mutation : PlantMutation = progression.get_all_mutations()[progression.mutations_unlocked]
|
||||
progression.mutations_unlocked += 1
|
||||
if not progression.are_all_mutations_unlocked():
|
||||
var new_mutation : PlantMutation = progression.unlock_new_mutation()
|
||||
|
||||
get_tree().create_timer(1.).timeout.connect(
|
||||
func (): %MutationAnnounce.announce_mutation = new_mutation
|
||||
);
|
||||
|
||||
if progression.mutations_unlocked == len(progression.get_all_mutations()):
|
||||
if progression.are_all_mutations_unlocked():
|
||||
SteamConnection.unlock_achievement(SteamConnection.ACH_UNLOCK_ALL_MUTATION)
|
||||
|
||||
else:
|
||||
|
||||
@@ -61,7 +61,7 @@ func generate_plants():
|
||||
elif plant_state == PlantData.State.DEAD:
|
||||
plant_data.day = plant_data.get_lifetime()
|
||||
for j in n_mutation_per_plant:
|
||||
var picked_mutation: PlantMutation = GameInfo.game_data.progression_data.available_mutations.pick_random().duplicate()
|
||||
var picked_mutation: PlantMutation = GameInfo.game_data.progression_data.get_available_mutations().pick_random().duplicate()
|
||||
picked_mutation.level = randi_range(min_level, max_level)
|
||||
plant_data.mutations.append(picked_mutation)
|
||||
var plant: Plant = Plant.new(plant_data)
|
||||
|
||||
@@ -174,7 +174,7 @@ static func generate_first_mutations(rarity := 0) -> Array[PlantMutation]:
|
||||
if rarity < 0:
|
||||
return []
|
||||
|
||||
var possible_mutation : PlantMutation = GameInfo.game_data.progression_data.available_mutations.filter(
|
||||
var possible_mutation : PlantMutation = GameInfo.game_data.progression_data.get_available_mutations().filter(
|
||||
func (m : PlantMutation): return m.get_base_rarity() <= rarity
|
||||
).pick_random().duplicate_deep()
|
||||
|
||||
@@ -211,7 +211,7 @@ class MutationPossibility:
|
||||
class AddMutation extends MutationPossibility:
|
||||
func mutate(mutations : Array[PlantMutation])-> Array[PlantMutation]:
|
||||
var new_mutations = mutations.duplicate_deep()
|
||||
var possible_new_mutations = GameInfo.game_data.progression_data.available_mutations.duplicate_deep()
|
||||
var possible_new_mutations = GameInfo.game_data.progression_data.get_available_mutations().duplicate_deep()
|
||||
|
||||
possible_new_mutations = possible_new_mutations.filter(
|
||||
func (m : PlantMutation):
|
||||
|
||||
Reference in New Issue
Block a user