Et toujours du dev pour la béta
* 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
This commit is contained in:
@@ -1,103 +1,85 @@
|
||||
extends Resource
|
||||
class_name RunData
|
||||
|
||||
enum State {STARTED, IN_PROGRESS, FINISHED}
|
||||
|
||||
const RUN_POINTS_NEXT_NUMBER : int = 2
|
||||
const RUN_POINT_MAX_LEVEL = 5 # TODO
|
||||
const VENDING_MACHINE_OCCURENCE = 3
|
||||
const CHALLENGE_CHANCE = 0.25
|
||||
|
||||
signal current_run_point_changed(rp : RunPoint)
|
||||
signal artefacts_changed(artefact : Array[Artefact])
|
||||
|
||||
var run_seed = randi()
|
||||
@export var next_run_points : Array[RunPoint] = generate_next_run_points()
|
||||
|
||||
@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 visited_run_points : Array[RunPoint] = []
|
||||
|
||||
@export var last_used_modifier_name = ""
|
||||
|
||||
@export var artefacts : Array[Artefact] = []
|
||||
|
||||
var plant_info = RunDataPlantInfo.new(self)
|
||||
|
||||
func get_state() -> State:
|
||||
if not current_run_point:
|
||||
return State.STARTED
|
||||
elif current_run_point.level == RUN_POINT_MAX_LEVEL:
|
||||
return State.FINISHED
|
||||
else :
|
||||
return State.IN_PROGRESS
|
||||
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(level = 0) -> Array[RunPoint]:
|
||||
|
||||
func generate_next_run_points() -> Array[RunPoint]:
|
||||
next_run_points = []
|
||||
|
||||
if level == RUN_POINT_MAX_LEVEL and GameInfo.game_data.game_mode == GameData.GameMode.STORY:
|
||||
return [
|
||||
generate_borea_base_run_point()
|
||||
]
|
||||
|
||||
for i in range(RUN_POINTS_NEXT_NUMBER):
|
||||
for i in range(story_step.get_run_point_number(level+1)):
|
||||
next_run_points.append(
|
||||
generate_next_run_point(level)
|
||||
generate_next_run_point()
|
||||
)
|
||||
|
||||
return next_run_points
|
||||
|
||||
func generate_next_run_point(level = 0) -> RunPoint:
|
||||
func generate_next_run_point() -> RunPoint:
|
||||
var region_parameter = RegionParameter.new()
|
||||
|
||||
var is_challenge = randf() < CHALLENGE_CHANCE
|
||||
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 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())
|
||||
|
||||
if level%VENDING_MACHINE_OCCURENCE == 0:
|
||||
region_parameter.modifiers.append(VendingMachineModifier.new())
|
||||
region_parameter.modifiers.append_array(
|
||||
story_step.get_story_modifiers_for_region(next_level)
|
||||
)
|
||||
|
||||
region_parameter.level = level
|
||||
region_parameter.objective = story_step.get_objective_for_region(next_level)
|
||||
|
||||
return RunPoint.new(
|
||||
level,
|
||||
region_parameter
|
||||
)
|
||||
|
||||
func generate_borea_base_run_point() -> RunPoint:
|
||||
var region_parameter = RegionParameter.new()
|
||||
region_parameter.level = RUN_POINT_MAX_LEVEL
|
||||
region_parameter.region_name = tr("BOREA_BASE")
|
||||
|
||||
return RunPoint.new(
|
||||
RUN_POINT_MAX_LEVEL,
|
||||
region_parameter
|
||||
)
|
||||
|
||||
func get_next_run_points() -> Array[RunPoint]:
|
||||
if current_run_point and current_run_point.level == RUN_POINT_MAX_LEVEL:
|
||||
return []
|
||||
return next_run_points
|
||||
|
||||
func choose_next_run_point(run_point : RunPoint) -> RunPoint:
|
||||
if current_run_point:
|
||||
visited_run_points.append(current_run_point)
|
||||
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(current_run_point.level + 1)
|
||||
if len(current_run_point.region_parameter.modifiers):
|
||||
last_used_modifier_name = current_run_point.region_parameter.modifiers[0].get_modifier_name()
|
||||
next_run_points = generate_next_run_points()
|
||||
return current_run_point
|
||||
|
||||
#endregion
|
||||
@@ -118,7 +100,8 @@ func generate_normal_modifiers() -> Array[RegionModifier]:
|
||||
func generate_benefic_modifiers() -> Array[RegionModifier]:
|
||||
return [
|
||||
VendingMachineModifier.new(),
|
||||
ResonnanceModifier.new()
|
||||
ResonnanceModifier.new(),
|
||||
InstableModifier.new(),
|
||||
]
|
||||
|
||||
|
||||
@@ -127,6 +110,7 @@ func generate_challenge_modifiers() -> Array[RegionModifier]:
|
||||
RockyModifier.new(),
|
||||
RadioactiveModifier.new(),
|
||||
ContaminatedModifier.new(),
|
||||
StormModifier.new(),
|
||||
]
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
extends Node
|
||||
class_name RunDataPlantInfo
|
||||
|
||||
signal updated
|
||||
|
||||
const DEFAULT_GROWING_TIME = 2
|
||||
const DEFAULT_LIFETIME = 6
|
||||
const DEFAULT_BASE_SCORE = 1
|
||||
const DEFAULT_SEED_NUMBER = 2
|
||||
const DEFAULT_SEED_RANDOM_LOOSE = 1
|
||||
const DEFAULT_PLANT_INFLUENCE_RADIUS = 100
|
||||
const DEFAULT_MUTATION_PROBABILITY = 0.3
|
||||
const DEFAULT_MUTATION_MAX_NUMBER = 2
|
||||
|
||||
var run_data : RunData
|
||||
|
||||
@@ -24,6 +24,9 @@ func get_growing_time() -> int:
|
||||
|
||||
for rm in get_region_modifiers():
|
||||
growing_time = rm.modify_plant_growing_time(growing_time)
|
||||
|
||||
for a in run_data.artefacts:
|
||||
growing_time = a.modify_plant_growing_time(growing_time)
|
||||
|
||||
return max(0, growing_time)
|
||||
|
||||
@@ -32,6 +35,9 @@ func get_lifetime() -> int:
|
||||
|
||||
for rm in get_region_modifiers():
|
||||
lifetime = rm.modify_plant_lifetime(lifetime)
|
||||
|
||||
for a in run_data.artefacts:
|
||||
lifetime = a.modify_plant_lifetime(lifetime)
|
||||
|
||||
return max(0, lifetime)
|
||||
|
||||
@@ -40,6 +46,9 @@ func get_base_score() -> int:
|
||||
|
||||
for rm in get_region_modifiers():
|
||||
base_score = rm.modify_plant_base_score(base_score)
|
||||
|
||||
for a in run_data.artefacts:
|
||||
base_score = a.modify_plant_base_score(base_score)
|
||||
|
||||
return max(0, base_score)
|
||||
|
||||
@@ -48,6 +57,9 @@ func get_seed_number() -> int:
|
||||
|
||||
for rm in get_region_modifiers():
|
||||
seed_number = rm.modify_plant_seed_number(seed_number)
|
||||
|
||||
for a in run_data.artefacts:
|
||||
seed_number = a.modify_plant_seed_number(seed_number)
|
||||
|
||||
return max(0, seed_number)
|
||||
|
||||
@@ -56,6 +68,9 @@ func get_seed_random_loose() -> int:
|
||||
|
||||
for rm in get_region_modifiers():
|
||||
seed_random_loose = rm.modify_plant_seed_random_loose(seed_random_loose)
|
||||
|
||||
for a in run_data.artefacts:
|
||||
seed_random_loose = a.modify_plant_seed_random_loose(seed_random_loose)
|
||||
|
||||
return min(max(0, seed_random_loose),get_seed_number())
|
||||
|
||||
@@ -64,9 +79,33 @@ func get_influence_radius() -> int:
|
||||
|
||||
for rm in get_region_modifiers():
|
||||
influence_radius = rm.modify_plant_influence_radius(influence_radius)
|
||||
|
||||
for a in run_data.artefacts:
|
||||
influence_radius = a.modify_plant_influence_radius(influence_radius)
|
||||
|
||||
return max(0, influence_radius)
|
||||
|
||||
func get_mutation_probability() -> float:
|
||||
var mutation_probability = DEFAULT_MUTATION_PROBABILITY
|
||||
|
||||
for rm in get_region_modifiers():
|
||||
mutation_probability = rm.modify_mutation_probability(mutation_probability)
|
||||
|
||||
for a in run_data.artefacts:
|
||||
mutation_probability = a.modify_mutation_probability(mutation_probability)
|
||||
|
||||
return max(0., mutation_probability)
|
||||
|
||||
func get_mutation_max_number() -> int:
|
||||
var mutation_max_number = DEFAULT_MUTATION_MAX_NUMBER
|
||||
|
||||
for rm in get_region_modifiers():
|
||||
mutation_max_number = rm.modify_mutation_max_number(mutation_max_number)
|
||||
|
||||
for a in run_data.artefacts:
|
||||
mutation_max_number = a.modify_mutation_max_number(mutation_max_number)
|
||||
|
||||
return max(0., mutation_max_number)
|
||||
|
||||
func get_region_modifiers() -> Array[RegionModifier]:
|
||||
if run_data.current_run_point and run_data.current_run_point.region_parameter:
|
||||
|
||||
@@ -7,25 +7,21 @@ const TYPE_ICON = preload("res://common/icons/map-pin.svg")
|
||||
const OBJECTIVE_ICON = preload("res://common/icons/growth.svg")
|
||||
const CHARGE_ICON = preload("res://common/icons/bolt.svg")
|
||||
|
||||
@export var level : int = 0 # X pos along the planet, and difficulty
|
||||
@export var region_parameter : RegionParameter = RegionParameter.new() :
|
||||
set(v):
|
||||
region_parameter = v
|
||||
@export var position : float = 0
|
||||
|
||||
func _init(
|
||||
_level : int = 0,
|
||||
_region_parameter : RegionParameter = RegionParameter.new(),
|
||||
_position : float = randf_range(0.,1.),
|
||||
):
|
||||
level = _level
|
||||
region_parameter = _region_parameter
|
||||
region_parameter.level = level
|
||||
position = _position
|
||||
|
||||
func card_info() -> CardInfo:
|
||||
var info = CardInfo.new(
|
||||
region_parameter.region_name,
|
||||
region_parameter.get_region_name(),
|
||||
tr("REGION_TO_VISIT")
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user