* Ajout de la déblocage des mutation du mode infini dans le mode histoire * Ajout de plus de caverne * Rework de l'emplacement des distributeurs/cavernes * Rework de l'influence, plus de clarté sur les plantes influencées * 4 d'inventaire dans le mode infini * Fix du tuto de mouvement en 3D * Déblocage de toutes le mutations à la fin du jeu * Fix de bug de chargelent de scène multiple
41 lines
1.2 KiB
GDScript
41 lines
1.2 KiB
GDScript
extends ProgressionData
|
|
class_name StoryProgressionData
|
|
|
|
const START_UNLOCKED_MUTATIONS = 8
|
|
|
|
@export var planted_mutation_ids: Array[String] = []
|
|
@export var story_step_i := 0
|
|
@export var mutations_unlocked = START_UNLOCKED_MUTATIONS
|
|
|
|
func get_story_step() -> StoryStep:
|
|
return get_all_story_steps()[story_step_i]
|
|
|
|
func get_story_progression() -> float:
|
|
return max(0,float(story_step_i)) / len(
|
|
get_all_story_steps()
|
|
)
|
|
|
|
func discover_mutation(pm : PlantMutation) -> void:
|
|
planted_mutation_ids.append(pm.id)
|
|
|
|
func get_mutations_discovered() -> Array[String]:
|
|
return planted_mutation_ids
|
|
|
|
func next_story_step() -> void:
|
|
get_story_step()._on_finish()
|
|
if story_step_i + 1 < len(get_all_story_steps()):
|
|
story_step_i += 1
|
|
|
|
func get_available_mutations() -> Array[PlantMutation]:
|
|
return get_all_mutations().slice(0, mutations_unlocked)
|
|
|
|
func are_all_mutations_unlocked() -> bool:
|
|
return mutations_unlocked >= len(get_all_mutations())
|
|
|
|
func unlock_new_mutation() -> PlantMutation:
|
|
var new_mutation = get_all_mutations()[mutations_unlocked]
|
|
mutations_unlocked += 1
|
|
return new_mutation
|
|
|
|
func unlock_all_mutation() -> void:
|
|
mutations_unlocked = len(get_all_mutations()) + 1 |