Ajout d'un mode infini
This commit is contained in:
36
common/game_data/scripts/story/infinite_story_step.gd
Normal file
36
common/game_data/scripts/story/infinite_story_step.gd
Normal file
@@ -0,0 +1,36 @@
|
||||
@tool
|
||||
extends StoryStep
|
||||
class_name InfiniteStoryStep
|
||||
|
||||
var run_number := 0
|
||||
|
||||
func _init(
|
||||
_run_number := 0
|
||||
):
|
||||
run_number = _run_number
|
||||
|
||||
|
||||
func get_respawn_scene() -> Scene:
|
||||
return RelayBaseScene.new(
|
||||
"INFINITE_MODE",
|
||||
str(run_number),
|
||||
true
|
||||
)
|
||||
|
||||
func get_cave_occurence(_level : int) -> int:
|
||||
return 0
|
||||
|
||||
func is_region_sequence_infinite() -> bool:
|
||||
return true
|
||||
|
||||
func get_region_sequence_length() -> int:
|
||||
return 1000
|
||||
|
||||
func is_run_point_dangerous(level : int) -> bool:
|
||||
return level%6 == 0 and level != 0
|
||||
|
||||
func get_destination_text() -> String:
|
||||
return tr("INFINITE")
|
||||
|
||||
func get_destination_scene() -> Scene:
|
||||
return BoreaScene.new()
|
||||
@@ -0,0 +1 @@
|
||||
uid://bdonub7t01xmi
|
||||
@@ -12,6 +12,8 @@ func get_destination_scene() -> Scene:
|
||||
return BoreaScene.new()
|
||||
|
||||
func get_run_progress(level : int) -> int:
|
||||
if is_region_sequence_infinite():
|
||||
return 0
|
||||
return get_region_sequence_length() - level
|
||||
|
||||
func get_ship_dialog_path(_level : int, _ship_in_space := true) -> String:
|
||||
@@ -19,8 +21,13 @@ func get_ship_dialog_path(_level : int, _ship_in_space := true) -> String:
|
||||
#region ------------------ Run ------------------
|
||||
|
||||
func is_run_finished(level : int) -> bool:
|
||||
if is_region_sequence_infinite():
|
||||
return false
|
||||
return level == get_region_sequence_length() - 1
|
||||
|
||||
func is_region_sequence_infinite() -> bool:
|
||||
return false
|
||||
|
||||
func get_region_sequence_length() -> int:
|
||||
return 7
|
||||
|
||||
@@ -48,6 +55,8 @@ func get_charge_number(_level : int) -> int:
|
||||
return 10
|
||||
|
||||
func is_run_point_dangerous(level : int) -> bool:
|
||||
if is_region_sequence_infinite():
|
||||
return false
|
||||
return level == get_region_sequence_length() - 2
|
||||
|
||||
func get_objective_for_region(level : int) -> int:
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@tool
|
||||
extends StoryStep
|
||||
class_name MercuryStoryStep
|
||||
|
||||
|
||||
Reference in New Issue
Block a user