* Changement de l'UI, ajouts de l'inspecteur par carte et changement de police * Ajout d'un semblant d'exploration * Ajout de la sauvegarde des entités * Restructuration mineure de l'arborescence * Fix divers et réécriture des textes
71 lines
2.4 KiB
GDScript
71 lines
2.4 KiB
GDScript
extends Resource
|
|
class_name GameData
|
|
|
|
signal current_planet_data_updated(p : PlanetData)
|
|
|
|
func _init():
|
|
set_default_unlocked()
|
|
|
|
@export var tutorial_done = false
|
|
|
|
@export var current_planet_data : PlanetData = PlanetData.new() :
|
|
set(v):
|
|
current_planet_data = v
|
|
current_planet_data_updated.emit(v)
|
|
@export var player_data : PlayerData = PlayerData.new()
|
|
|
|
@export var unlocked_plant_types : Array[PlantType] = []
|
|
@export var unlocked_plant_mutations : Array[PlantMutation] = []
|
|
@export var unlocked_machines : Array[MachineType] = []
|
|
|
|
@export var truck_data : TruckData = TruckData.new()
|
|
|
|
func set_default_unlocked():
|
|
unlocked_plant_types = all_plant_types()
|
|
unlocked_plant_mutations = all_plant_mutations()
|
|
unlocked_machines = all_machines()
|
|
|
|
func reset_planet():
|
|
current_planet_data = PlanetData.new()
|
|
|
|
func reset_player():
|
|
player_data = PlayerData.new()
|
|
|
|
func reset_truck():
|
|
truck_data = TruckData.new()
|
|
|
|
func reset_all():
|
|
reset_planet()
|
|
reset_player()
|
|
reset_truck()
|
|
|
|
|
|
|
|
func all_plant_types() -> Array[PlantType]:
|
|
return [
|
|
preload("res://entities/plants/resources/plant_types/champ.tres"),
|
|
preload("res://entities/plants/resources/plant_types/chardi.tres"),
|
|
preload("res://entities/plants/resources/plant_types/ferno.tres"),
|
|
preload("res://entities/plants/resources/plant_types/maias.tres"),
|
|
preload("res://entities/plants/resources/plant_types/philea.tres"),
|
|
preload("res://entities/plants/resources/plant_types/pili.tres"),
|
|
preload("res://entities/plants/resources/plant_types/solita.tres"),
|
|
]
|
|
|
|
func all_machines() -> Array[MachineType]:
|
|
return [
|
|
preload("res://entities/interactables/machines/solar_pannel/solar_pannel.tres"),
|
|
]
|
|
|
|
func all_plant_mutations() -> Array[PlantMutation]:
|
|
return [
|
|
preload("res://entities/plants/resources/plant_mutations/ancient_mutation.tres"),
|
|
preload("res://entities/plants/resources/plant_mutations/elitist_mutation.tres"),
|
|
preload("res://entities/plants/resources/plant_mutations/ermit_mutation.tres"),
|
|
preload("res://entities/plants/resources/plant_mutations/precocious_mutation.tres"),
|
|
preload("res://entities/plants/resources/plant_mutations/quality_mutation.tres"),
|
|
preload("res://entities/plants/resources/plant_mutations/quick_mutation.tres"),
|
|
preload("res://entities/plants/resources/plant_mutations/sociable_mutation.tres"),
|
|
preload("res://entities/plants/resources/plant_mutations/strong_mutation.tres"),
|
|
]
|