* Evolution de l'histoire avec de nouveaux dialogues, une plus grande durée de vie du jeu, des nouvelles zones d'histoire... * Suppression du mode infini * Ajout d'un écran des mutations découvertes * Ajout d'un nouveau mécanisme de respawn situé dans le vaissau * Ajout de 2 nouveaux modificateurs de région * Quatre nouveaux artefacts * Visuel de la décontamination de la planète 3D en cours de la partie * Ajout d'une annonce visuelle des scène du jeu * Fix sur la mutation Généreux pour être en accord avec sa description * Amélioration de l'effet de la mutation Purification * Fix de la mutation sociale aux niveau supérieurs * Ajout d'un effet visuel de réacteur sur le joueur 3D * Fix sur l'annonce de nouveaux objets qui se déclenchaient à une nouvelle run * Amélioration des animation et des informations données dans le vaisseau * Correction mineure des traductions
125 lines
3.4 KiB
GDScript
125 lines
3.4 KiB
GDScript
extends Resource
|
|
class_name RunData
|
|
|
|
const RUN_POINTS_NEXT_NUMBER : int = 2
|
|
const RUN_POINT_MAX_LEVEL = 5 # TODO
|
|
|
|
signal current_run_point_changed(rp : RunPoint)
|
|
|
|
var run_seed = randi()
|
|
|
|
@export var level = 0
|
|
@export var story_step : StoryStep
|
|
@export var next_run_points : Array[RunPoint]
|
|
@export var current_run_point : RunPoint = null :
|
|
set(v):
|
|
current_run_point = v
|
|
current_run_point_changed.emit(v)
|
|
|
|
@export var artefacts : Array[Artefact] = []
|
|
|
|
var plant_info = RunDataPlantInfo.new(self)
|
|
|
|
func is_finished() -> bool:
|
|
return story_step.is_run_finished(level)
|
|
|
|
func get_progress() -> int:
|
|
return story_step.get_run_progress(level)
|
|
|
|
#region ------------------ Run Points ------------------
|
|
|
|
func generate_next_run_points() -> Array[RunPoint]:
|
|
next_run_points = []
|
|
|
|
for i in range(story_step.get_run_point_number(level+1)):
|
|
next_run_points.append(
|
|
generate_next_run_point()
|
|
)
|
|
|
|
return next_run_points
|
|
|
|
func generate_next_run_point() -> RunPoint:
|
|
var region_parameter = RegionParameter.new()
|
|
|
|
var next_level = level+1
|
|
|
|
if story_step.need_gameplay_modifier(next_level):
|
|
var is_challenge = randf() < story_step.get_challenge_chance(next_level)
|
|
if is_challenge:
|
|
region_parameter.modifiers = [
|
|
generate_challenge_modifiers().pick_random(),
|
|
generate_benefic_modifiers().pick_random()
|
|
] as Array[RegionModifier]
|
|
else:
|
|
region_parameter.modifiers = [
|
|
generate_normal_modifiers().pick_random()
|
|
] as Array[RegionModifier]
|
|
|
|
|
|
var first_vending = story_step.get_first_vending_machine_occurence(next_level)
|
|
var vending_occurence = story_step.get_vending_machine_occurence(next_level)
|
|
if vending_occurence > 0:
|
|
if (level - first_vending)%vending_occurence == 0:
|
|
region_parameter.modifiers.append(VendingMachineModifier.new())
|
|
|
|
region_parameter.modifiers.append_array(
|
|
story_step.get_story_modifiers_for_region(next_level)
|
|
)
|
|
|
|
region_parameter.objective = story_step.get_objective_for_region(next_level)
|
|
|
|
return RunPoint.new(
|
|
region_parameter
|
|
)
|
|
|
|
|
|
func choose_next_run_point(run_point : RunPoint = null) -> RunPoint:
|
|
if run_point == null:
|
|
run_point = generate_next_run_point()
|
|
level += 1
|
|
current_run_point = run_point
|
|
GameInfo.game_data.start_region(run_point.region_parameter)
|
|
next_run_points = generate_next_run_points()
|
|
return current_run_point
|
|
|
|
#endregion
|
|
|
|
#region ------------------ Modifiers ------------------
|
|
|
|
func generate_normal_modifiers() -> Array[RegionModifier]:
|
|
return [
|
|
AridModifier.new(),
|
|
HumidModifier.new(),
|
|
PoorModifier.new(),
|
|
HarshModifier.new(),
|
|
ToxicModifier.new(),
|
|
SandyModifier.new(),
|
|
|
|
]
|
|
|
|
func generate_benefic_modifiers() -> Array[RegionModifier]:
|
|
return [
|
|
VendingMachineModifier.new(),
|
|
ResonnanceModifier.new(),
|
|
InstableModifier.new(),
|
|
]
|
|
|
|
|
|
func generate_challenge_modifiers() -> Array[RegionModifier]:
|
|
return [
|
|
RockyModifier.new(),
|
|
RadioactiveModifier.new(),
|
|
ContaminatedModifier.new(),
|
|
StormModifier.new(),
|
|
]
|
|
|
|
#endregion
|
|
|
|
#region ------------------ Artefacts ------------------
|
|
|
|
func add_artefacts(a: Artefact):
|
|
artefacts.append(a)
|
|
GameInfo.game_data.player_data.update_with_artefacts(artefacts)
|
|
|
|
#endregion
|