Dev 0.1
* Ajout des modes de jeu * Dev de subterra et estia * Ajout de tous les dialogues et traduction * Ajout d'un splashscreen
This commit is contained in:
@@ -14,6 +14,14 @@ func _init(
|
||||
progression_data = StoryProgressionData.new()
|
||||
elif game_mode == Mode.INFINITE:
|
||||
progression_data = InfiniteProgressionData.new()
|
||||
|
||||
if GameInfo:
|
||||
max_energy_announced = progression_data.get_story_step().get_player_max_energy(
|
||||
GameInfo.settings_data.story_mode_difficulty
|
||||
)
|
||||
max_inventory_announced = progression_data.get_story_step().get_player_max_inventory(
|
||||
GameInfo.settings_data.story_mode_difficulty
|
||||
)
|
||||
|
||||
|
||||
@export var game_mode : Mode = GameData.Mode.STORY
|
||||
@@ -41,8 +49,8 @@ func _init(
|
||||
@export var dead_orchid_rotation : Vector3
|
||||
|
||||
@export var item_announced = []
|
||||
@export var max_energy_announced = PlayerData.DEFAULT_MAX_ENERGY
|
||||
@export var max_inventory_announced = PlayerData.DEFAULT_INVENTORY_SIZE
|
||||
@export var max_energy_announced : int
|
||||
@export var max_inventory_announced : int
|
||||
|
||||
@export var dialogs_done : Array[String] = [] #Chemin des dialogues terminés
|
||||
@export var tutorials_done : Array[String] = []
|
||||
@@ -52,6 +60,10 @@ func start_run() -> RunData:
|
||||
player_data.clear_inventory()
|
||||
current_run = RunData.new()
|
||||
current_run.story_step = progression_data.get_story_step().duplicate_deep()
|
||||
current_run.difficulty_setting = (
|
||||
1 if progression_data == InfiniteProgressionData
|
||||
else GameInfo.settings_data.story_mode_difficulty
|
||||
)
|
||||
current_run.generate_next_run_points()
|
||||
current_run.current_run_point_changed.connect(
|
||||
func(rp : RunPoint):
|
||||
|
||||
@@ -17,21 +17,22 @@ var run_seed = randi()
|
||||
current_run_point_changed.emit(v)
|
||||
|
||||
@export var artefacts : Array[Artefact] = []
|
||||
@export var difficulty_setting : int = 1
|
||||
|
||||
var plant_info = RunDataPlantInfo.new(self)
|
||||
|
||||
func is_finished() -> bool:
|
||||
return story_step.is_run_finished(level)
|
||||
return story_step.is_run_finished(level, difficulty_setting)
|
||||
|
||||
func get_progress() -> int:
|
||||
return story_step.get_run_progress(level)
|
||||
return story_step.get_run_progress(level, difficulty_setting)
|
||||
|
||||
#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)):
|
||||
for i in range(story_step.get_run_point_number(level+1, difficulty_setting)):
|
||||
var last_modifiers : Array[String] = []
|
||||
if len(next_run_points):
|
||||
for m in next_run_points[0].region_parameter.modifiers:
|
||||
@@ -57,14 +58,14 @@ func generate_next_run_point(last_modifiers : Array[String] = []) -> RunPoint:
|
||||
func(m : RegionModifier): return not m.modifier_name in last_modifiers
|
||||
)
|
||||
|
||||
if story_step.need_gameplay_modifier(next_level):
|
||||
var is_challenge = randf() < story_step.get_challenge_chance(next_level)
|
||||
if story_step.need_gameplay_modifier(next_level, difficulty_setting):
|
||||
var is_challenge = randf() < story_step.get_challenge_chance(next_level, difficulty_setting)
|
||||
if is_challenge:
|
||||
region_parameter.modifiers = [
|
||||
challenge_modifiers.pick_random(),
|
||||
benefic_modifiers.pick_random()
|
||||
] as Array[RegionModifier]
|
||||
elif story_step.is_run_point_dangerous(next_level):
|
||||
elif story_step.is_run_point_dangerous(next_level, difficulty_setting):
|
||||
region_parameter.modifiers = [
|
||||
challenge_modifiers.pick_random()
|
||||
] as Array[RegionModifier]
|
||||
@@ -75,15 +76,15 @@ func generate_next_run_point(last_modifiers : Array[String] = []) -> RunPoint:
|
||||
|
||||
|
||||
region_parameter.modifiers.append_array(
|
||||
story_step.get_gameplay_modifiers_for_region(next_level)
|
||||
story_step.get_gameplay_modifiers_for_region(next_level, difficulty_setting)
|
||||
)
|
||||
|
||||
region_parameter.modifiers.append_array(
|
||||
story_step.get_story_modifiers_for_region(next_level)
|
||||
story_step.get_story_modifiers_for_region(next_level, difficulty_setting)
|
||||
)
|
||||
|
||||
region_parameter.objective = story_step.get_objective_for_region(next_level)
|
||||
region_parameter.charge = story_step.get_charge_number(next_level)
|
||||
region_parameter.objective = story_step.get_objective_for_region(next_level, difficulty_setting)
|
||||
region_parameter.charge = story_step.get_charge_number(next_level, difficulty_setting)
|
||||
|
||||
|
||||
return RunPoint.new(
|
||||
@@ -101,7 +102,7 @@ func choose_next_run_point(run_point : RunPoint = null) -> RunPoint:
|
||||
return current_run_point
|
||||
|
||||
func get_cockpit_exit_scene() -> Scene:
|
||||
if story_step.is_run_finished(level):
|
||||
if story_step.is_run_finished(level, difficulty_setting):
|
||||
return story_step.get_destination_scene()
|
||||
else :
|
||||
return RegionScene.new(GameInfo.game_data.current_region_data)
|
||||
|
||||
@@ -72,6 +72,14 @@ const AVAILABLE_LANGUAGES_LABEL = [
|
||||
|
||||
#region ------------------ Game ------------------
|
||||
|
||||
const AVAILABLE_DIFFICULTY = [
|
||||
"COSY_MODE",
|
||||
"ADVENTURE_MODE",
|
||||
"CHALLENGE_MODE"
|
||||
]
|
||||
|
||||
@export var story_mode_difficulty := 1 # Voir AVAILABLE_DIFFICULTY
|
||||
|
||||
@export var auto_pickup := true
|
||||
|
||||
@export var mouse_sensivity := 0.2
|
||||
|
||||
@@ -17,20 +17,29 @@ func get_respawn_scene() -> Scene:
|
||||
true
|
||||
)
|
||||
|
||||
func get_cave_occurence(_level : int) -> int:
|
||||
func get_player_max_energy(_difficulty_setting : int) -> int:
|
||||
return 4
|
||||
|
||||
func get_player_max_inventory(_difficulty_setting : int) -> int:
|
||||
return 3
|
||||
|
||||
func get_objective_for_region(level : int, _difficulty_setting : int) -> int:
|
||||
return basic_objective_for_region(level)
|
||||
|
||||
func get_cave_occurence(_level : int, _difficulty_setting : int) -> int:
|
||||
return 0
|
||||
|
||||
func is_region_sequence_infinite() -> bool:
|
||||
return true
|
||||
|
||||
func get_region_sequence_length() -> int:
|
||||
func get_region_sequence_length(_difficulty_setting) -> int:
|
||||
return 1000
|
||||
|
||||
func is_run_point_dangerous(level : int) -> bool:
|
||||
func is_run_point_dangerous(level : int, _difficulty_setting : int) -> bool:
|
||||
return level%6 == 0 and level != 0
|
||||
|
||||
func get_destination_text() -> String:
|
||||
return tr("INFINITE")
|
||||
return ""
|
||||
|
||||
func get_destination_scene() -> Scene:
|
||||
return BoreaScene.new()
|
||||
return BoreaScene.new()
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
extends Resource
|
||||
class_name StoryStep
|
||||
|
||||
const COSY_ENERGY_ADDITION = 2
|
||||
const COSY_OBJECTIVE_FACTOR = 0.5
|
||||
|
||||
#region ------------------ Story ------------------
|
||||
|
||||
@abstract func get_respawn_scene() -> Scene
|
||||
@@ -11,98 +14,120 @@ class_name StoryStep
|
||||
func get_destination_scene() -> Scene:
|
||||
return BoreaScene.new()
|
||||
|
||||
func get_run_progress(level : int) -> int:
|
||||
func get_run_progress(level : int, difficulty_setting : int) -> int:
|
||||
if is_region_sequence_infinite():
|
||||
return 0
|
||||
return get_region_sequence_length() - level
|
||||
return get_region_sequence_length(difficulty_setting) - level
|
||||
|
||||
func get_ship_dialog_path(_level : int, _ship_in_space := true) -> String:
|
||||
func get_ship_dialog_path(_level : int, _difficulty_setting : int, _ship_in_space := true) -> String:
|
||||
return ""
|
||||
#region ------------------ Run ------------------
|
||||
|
||||
func is_run_finished(level : int) -> bool:
|
||||
func is_run_finished(level : int, difficulty_setting : int) -> bool:
|
||||
if is_region_sequence_infinite():
|
||||
return false
|
||||
return level == get_region_sequence_length() - 1
|
||||
return level == get_region_sequence_length(difficulty_setting) - 1
|
||||
|
||||
func is_region_sequence_infinite() -> bool:
|
||||
return false
|
||||
|
||||
func get_player_max_energy() -> int:
|
||||
func get_player_max_energy(difficulty_setting : int) -> int:
|
||||
if difficulty_setting == 0:
|
||||
return PlayerData.DEFAULT_MAX_ENERGY + COSY_ENERGY_ADDITION
|
||||
return PlayerData.DEFAULT_MAX_ENERGY
|
||||
|
||||
func get_player_max_inventory() -> int:
|
||||
func get_player_max_inventory(_difficulty_setting : int) -> int:
|
||||
return PlayerData.DEFAULT_INVENTORY_SIZE
|
||||
|
||||
func get_region_sequence_length() -> int:
|
||||
return 3 #TOCHANGE TO 7
|
||||
func get_region_sequence_length(_difficulty_setting : int) -> int:
|
||||
return 8
|
||||
|
||||
func get_first_vending_machine_occurence(_level : int) -> int:
|
||||
func get_first_vending_machine_occurence(_level : int, _difficulty_setting : int) -> int:
|
||||
return 2
|
||||
|
||||
func get_vending_machine_occurence(_level : int) -> int:
|
||||
func get_vending_machine_occurence(_level : int, _difficulty_setting : int) -> int:
|
||||
return 3
|
||||
|
||||
func get_first_cave_occurence(level : int) -> int:
|
||||
return get_cave_occurence(level)
|
||||
func get_first_cave_occurence(level : int, difficulty_setting : int) -> int:
|
||||
return get_cave_occurence(level, difficulty_setting)
|
||||
|
||||
func get_cave_occurence(_level : int) -> int:
|
||||
func get_cave_occurence(_level : int, _difficulty_setting : int) -> int:
|
||||
return 3
|
||||
|
||||
func get_challenge_chance(_level : int) -> float:
|
||||
func get_challenge_chance(_level : int, _difficulty_setting : int) -> float:
|
||||
return 0.15
|
||||
|
||||
func get_run_point_number(level : int) -> int:
|
||||
if is_run_finished(level):
|
||||
func get_run_point_number(level : int, difficulty_setting : int) -> int:
|
||||
if is_run_finished(level, difficulty_setting):
|
||||
return 1
|
||||
return 2
|
||||
|
||||
func get_charge_number(_level : int) -> int:
|
||||
func get_charge_number(_level : int, _difficulty_setting : int) -> int:
|
||||
return 10
|
||||
|
||||
func is_run_point_dangerous(level : int) -> bool:
|
||||
func is_run_point_dangerous(level : int, difficulty_setting : int) -> bool:
|
||||
if is_region_sequence_infinite():
|
||||
return false
|
||||
return level == get_region_sequence_length() - 2
|
||||
return level == get_region_sequence_length(difficulty_setting) - 2
|
||||
|
||||
func get_objective_for_region(level : int) -> int:
|
||||
static func basic_objective_for_region(level : int) -> int:
|
||||
match level:
|
||||
1: return 10
|
||||
2: return 15
|
||||
3: return 20
|
||||
4: return 30
|
||||
5: return 45
|
||||
_: return get_objective_for_region(level-1) + (level-2) * 5
|
||||
_: return basic_objective_for_region(level-1) + (level-2) * 5
|
||||
|
||||
func get_story_modifiers_for_region(level : int) -> Array[RegionModifier]:
|
||||
static func difficult_objective_for_region(level : int) -> int:
|
||||
match level:
|
||||
1: return 10
|
||||
2: return 20
|
||||
3: return 30
|
||||
_: return difficult_objective_for_region(level-1) + (level-1) * 5
|
||||
|
||||
func get_objective_multiplier() -> float:
|
||||
return 1.
|
||||
|
||||
func get_objective_for_region(level : int, difficulty_setting : int) -> int:
|
||||
var objective = basic_objective_for_region(level)
|
||||
|
||||
if difficulty_setting == 0:
|
||||
objective = roundi(objective * COSY_OBJECTIVE_FACTOR)
|
||||
elif difficulty_setting == 2:
|
||||
return difficult_objective_for_region(level)
|
||||
|
||||
return max(1,roundi(objective * get_objective_multiplier()))
|
||||
|
||||
func get_story_modifiers_for_region(level : int, difficulty_setting : int) -> Array[RegionModifier]:
|
||||
var modifiers : Array[RegionModifier] = []
|
||||
if is_run_finished(level):
|
||||
if is_run_finished(level, difficulty_setting):
|
||||
var dest_mod = DestinationModifier.new()
|
||||
dest_mod.destination_scene = get_destination_scene()
|
||||
modifiers.append(dest_mod)
|
||||
|
||||
return modifiers
|
||||
|
||||
func get_gameplay_modifiers_for_region(level : int) -> Array[RegionModifier]:
|
||||
func get_gameplay_modifiers_for_region(level : int, difficulty_setting : int) -> Array[RegionModifier]:
|
||||
var modifiers : Array[RegionModifier] = []
|
||||
|
||||
if need_gameplay_modifier(level):
|
||||
var first_vending = get_first_vending_machine_occurence(level)
|
||||
var vending_occurence = get_vending_machine_occurence(level)
|
||||
if need_gameplay_modifier(level,difficulty_setting):
|
||||
var first_vending = get_first_vending_machine_occurence(level, difficulty_setting)
|
||||
var vending_occurence = get_vending_machine_occurence(level, difficulty_setting)
|
||||
if vending_occurence > 0 and level >= first_vending:
|
||||
if (level - first_vending)%vending_occurence == 0:
|
||||
modifiers.append(VendingMachineModifier.new())
|
||||
|
||||
var first_cave = get_first_cave_occurence(level)
|
||||
var cave_occurence = get_cave_occurence(level)
|
||||
var first_cave = get_first_cave_occurence(level, difficulty_setting)
|
||||
var cave_occurence = get_cave_occurence(level, difficulty_setting)
|
||||
if cave_occurence > 0 and level >= first_cave:
|
||||
if (level - first_cave)%cave_occurence == 0:
|
||||
modifiers.append(CaveModifier.new())
|
||||
|
||||
return modifiers
|
||||
|
||||
func need_gameplay_modifier(level : int):
|
||||
if is_run_finished(level):
|
||||
func need_gameplay_modifier(level : int, difficulty_setting : int):
|
||||
if is_run_finished(level, difficulty_setting):
|
||||
return false
|
||||
return true
|
||||
|
||||
|
||||
@@ -9,16 +9,16 @@ func get_respawn_scene() -> Scene:
|
||||
func get_destination_text() -> String:
|
||||
return ""
|
||||
|
||||
func get_region_sequence_length() -> int:
|
||||
func get_region_sequence_length(_difficulty_setting : int) -> int:
|
||||
return 1
|
||||
|
||||
func get_destination_scene() -> Scene: return null
|
||||
|
||||
func need_gameplay_modifier(_level : int): return false
|
||||
func need_gameplay_modifier(_level : int, _difficulty_setting : int): return false
|
||||
|
||||
func get_objective_for_region(_level : int) -> int: return 3
|
||||
func get_objective_for_region(_level : int, _difficulty_setting : int) -> int: return 3
|
||||
|
||||
func get_story_modifiers_for_region(_n : int) -> Array[RegionModifier]:
|
||||
func get_story_modifiers_for_region(_n : int, _difficulty_setting : int) -> Array[RegionModifier]:
|
||||
return [
|
||||
TutorialModifier.new()
|
||||
]
|
||||
|
||||
@@ -16,33 +16,30 @@ func get_destination_scene() -> Scene:
|
||||
"001"
|
||||
)
|
||||
|
||||
func get_cave_occurence(_level : int) -> int:
|
||||
func get_cave_occurence(_level : int, _difficulty_setting : int) -> int:
|
||||
return 2
|
||||
|
||||
func get_region_sequence_length() -> int:
|
||||
func get_region_sequence_length(_difficulty_setting : int) -> int:
|
||||
return 5
|
||||
|
||||
func get_objective_for_region(level : int) -> int:
|
||||
match level:
|
||||
1: return 6
|
||||
2: return 10
|
||||
3: return 16
|
||||
4: return 24
|
||||
5: return 34
|
||||
_: return get_objective_for_region(level-1) + (level-2) * 5
|
||||
func get_objective_multiplier() -> float:
|
||||
return 0.6
|
||||
|
||||
func get_first_vending_machine_occurence(_level : int) -> int:
|
||||
func is_run_point_dangerous(_level : int, _difficulty_setting : int) -> bool:
|
||||
return false
|
||||
|
||||
func get_first_vending_machine_occurence(_level : int, _difficulty_setting : int) -> int:
|
||||
return 0
|
||||
|
||||
func get_vending_machine_occurence(_level : int) -> int:
|
||||
func get_vending_machine_occurence(_level : int, _difficulty_setting : int) -> int:
|
||||
return 0
|
||||
|
||||
func get_challenge_chance(_level : int) -> float:
|
||||
func get_challenge_chance(_level : int, _difficulty_setting : int) -> float:
|
||||
return 0.
|
||||
|
||||
func get_ship_dialog_path(level : int, ship_in_space := true) -> String:
|
||||
if ship_in_space and level == get_cave_occurence(level) - 1:
|
||||
func get_ship_dialog_path(level : int, difficulty_setting : int ,ship_in_space := true) -> String:
|
||||
if ship_in_space and level == get_cave_occurence(level, difficulty_setting) - 1:
|
||||
return CAVE_DIALOG_PATH
|
||||
if ship_in_space and is_run_finished(level + 1):
|
||||
if ship_in_space and is_run_finished(level + 1, difficulty_setting):
|
||||
return MERCURY_ARRIVAL_DIALOG_PATH
|
||||
return ""
|
||||
@@ -23,11 +23,11 @@ func get_destination_scene() -> Scene:
|
||||
"002"
|
||||
)
|
||||
|
||||
func get_ship_dialog_path(level : int, ship_in_space := true) -> String:
|
||||
func get_ship_dialog_path(level : int, difficulty_setting : int, ship_in_space := true) -> String:
|
||||
if level == 0:
|
||||
return MERCURY_DEPARTURE_DIALOG_PATH
|
||||
if level == 2:
|
||||
return VENDING_MACHINE_DIALOG_PATH
|
||||
if ship_in_space and is_run_finished(level + 1):
|
||||
if ship_in_space and is_run_finished(level + 1, difficulty_setting):
|
||||
return VENUS_ARRIVAL_DIALOG_PATH
|
||||
return ""
|
||||
@@ -16,11 +16,13 @@ func get_destination_text() -> String:
|
||||
func get_destination_scene() -> Scene:
|
||||
return BoreaScene.new()
|
||||
|
||||
func get_player_max_energy() -> int:
|
||||
func get_player_max_energy(difficulty_setting := 1) -> int:
|
||||
if difficulty_setting == 0:
|
||||
return 4 + COSY_ENERGY_ADDITION
|
||||
return 4
|
||||
|
||||
func get_player_max_inventory() -> int:
|
||||
func get_player_max_inventory(_difficulty_setting := 1) -> int:
|
||||
return 3
|
||||
|
||||
func get_ship_dialog_path(_level : int, _ship_in_space := true) -> String:
|
||||
func get_ship_dialog_path(_level : int, _difficulty_setting : int, _ship_in_space := true) -> String:
|
||||
return VENUS_DEPARTURE_DIALOG_PATH
|
||||
@@ -16,13 +16,15 @@ func get_destination_text() -> String:
|
||||
func get_destination_scene() -> Scene:
|
||||
return AquaScene.new()
|
||||
|
||||
func get_player_max_energy() -> int:
|
||||
func get_player_max_energy(difficulty_setting) -> int:
|
||||
if difficulty_setting == 0:
|
||||
return 4 + COSY_ENERGY_ADDITION
|
||||
return 4
|
||||
|
||||
func get_player_max_inventory() -> int:
|
||||
func get_player_max_inventory(_difficulty_setting) -> int:
|
||||
return 4
|
||||
|
||||
func get_ship_dialog_path(level : int, _ship_in_space := true) -> String:
|
||||
func get_ship_dialog_path(level : int, _difficulty_setting : int, _ship_in_space := true) -> String:
|
||||
if level == 5:
|
||||
return AQUA_TRAVEL_PHONE_CALL_DIALOG_PATH
|
||||
return ""
|
||||
@@ -16,13 +16,15 @@ func get_destination_text() -> String:
|
||||
func get_destination_scene() -> Scene:
|
||||
return SubterraScene.new()
|
||||
|
||||
func get_player_max_energy() -> int:
|
||||
func get_player_max_energy(difficulty_setting : int) -> int:
|
||||
if difficulty_setting == 0:
|
||||
return 4 + COSY_ENERGY_ADDITION
|
||||
return 4
|
||||
|
||||
func get_player_max_inventory() -> int:
|
||||
func get_player_max_inventory(_difficulty_setting : int) -> int:
|
||||
return 5
|
||||
|
||||
func get_ship_dialog_path(level : int, _ship_in_space := true) -> String:
|
||||
func get_ship_dialog_path(level : int, _difficulty_setting : int, _ship_in_space := true) -> String:
|
||||
if level == 5:
|
||||
return TRAVEL_PHONE_CALL_DIALOG_PATH
|
||||
return ""
|
||||
@@ -16,13 +16,15 @@ func get_destination_text() -> String:
|
||||
func get_destination_scene() -> Scene:
|
||||
return EstiaScene.new()
|
||||
|
||||
func get_player_max_energy() -> int:
|
||||
func get_player_max_energy(difficulty_setting : int) -> int:
|
||||
if difficulty_setting == 0:
|
||||
return 5 + COSY_ENERGY_ADDITION
|
||||
return 5
|
||||
|
||||
func get_player_max_inventory() -> int:
|
||||
func get_player_max_inventory(_difficulty_setting : int) -> int:
|
||||
return 5
|
||||
|
||||
func get_ship_dialog_path(level : int, _ship_in_space := true) -> String:
|
||||
func get_ship_dialog_path(level : int, _difficulty_setting : int, _ship_in_space := true) -> String:
|
||||
if level == 5:
|
||||
return TRAVEL_PHONE_CALL_DIALOG_PATH
|
||||
return ""
|
||||
@@ -16,13 +16,15 @@ func get_destination_text() -> String:
|
||||
func get_destination_scene() -> Scene:
|
||||
return AstraEndScene.new()
|
||||
|
||||
func get_player_max_energy() -> int:
|
||||
func get_player_max_energy(difficulty_setting : int) -> int:
|
||||
if difficulty_setting == 0:
|
||||
return 6 + COSY_ENERGY_ADDITION
|
||||
return 5
|
||||
|
||||
func get_player_max_inventory() -> int:
|
||||
func get_player_max_inventory(_difficulty_setting : int) -> int:
|
||||
return 6
|
||||
|
||||
func get_ship_dialog_path(level : int, _ship_in_space := true) -> String:
|
||||
func get_ship_dialog_path(level : int, _difficulty_setting : int, _ship_in_space := true) -> String:
|
||||
if level == 4:
|
||||
return TRAVEL_PHONE_CALL_DIALOG_PATH
|
||||
return ""
|
||||
Reference in New Issue
Block a user