2024-08-09 00:19:48 +02:00
|
|
|
default persistent.old_endings = None
|
|
|
|
default persistent.endings = None
|
|
|
|
|
|
|
|
# Store the general chapters inside an array for easy manipulation
|
|
|
|
define general_chapters = [
|
|
|
|
"chapter_1", "chapter_2", "chapter_3", "chapter_4", "chapter_5",
|
|
|
|
"chapter_6", "chapter_7", "chapter_8", "chapter_9", "chapter_10", "chapter_11"
|
|
|
|
]
|
|
|
|
|
|
|
|
define ending_routes = {
|
|
|
|
4: ["chapter_11D", "chapter_12D", "chapter_12_5D", "chapter_13D", "chapter_14D"],
|
|
|
|
3: ["chapter_11C", "chapter_12C", "chapter_12_5C", "chapter_13C", "chapter_14C"],
|
|
|
|
2: ["chapter_11B", "chapter_12B", "chapter_13B", "chapter_14B"],
|
|
|
|
1: ["chapter_11A", "chapter_12A", "chapter_12_5D", "chapter_13A", "chapter_14A"]
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
default chapters_array_length = len(general_chapters) - 1
|
|
|
|
|
2024-08-12 04:13:20 +02:00
|
|
|
default chapter_index = 0 # Index number for the current position of the general chapters array
|
|
|
|
|
2024-08-17 02:01:55 +02:00
|
|
|
# This stores the name of the label as a string
|
|
|
|
# When starting a new game, it takes the first element of the general_chapters array
|
|
|
|
default current_general_chapter = general_chapters[chapter_index]
|
2024-08-12 04:13:20 +02:00
|
|
|
|
|
|
|
default ending_route_number = None
|
2024-08-17 02:01:55 +02:00
|
|
|
default current_ending_chapter = None
|
2024-08-12 04:13:20 +02:00
|
|
|
default ending_chapter_index = 0
|
2024-08-09 00:19:48 +02:00
|
|
|
|
|
|
|
|
2021-09-23 01:06:37 +02:00
|
|
|
init -1 python:
|
2021-09-23 00:39:56 +02:00
|
|
|
def ending_image():
|
2021-10-14 21:17:08 +02:00
|
|
|
#0b0000, DCBA, flash the bits with |=, check with &
|
2021-09-23 00:39:56 +02:00
|
|
|
endings = 0b0000
|
|
|
|
_e = 0b1
|
|
|
|
for i in range(1, 5):
|
2021-10-14 21:17:08 +02:00
|
|
|
fn = "e"+str(i)+"of4"
|
2021-09-23 00:39:56 +02:00
|
|
|
endings |= (_e * renpy.seen_image(fn))
|
|
|
|
_e = _e << 0b1
|
2021-10-16 19:25:12 +02:00
|
|
|
persistent.old_endings = persistent.endings
|
2021-09-23 00:39:56 +02:00
|
|
|
persistent.endings = endings
|
|
|
|
|
2024-08-09 00:19:48 +02:00
|
|
|
|
|
|
|
init python:
|
|
|
|
|
|
|
|
def next_story_chapter():
|
|
|
|
global chapter_index
|
2024-08-17 02:01:55 +02:00
|
|
|
global current_general_chapter
|
2024-08-09 00:19:48 +02:00
|
|
|
global ending_route_number
|
|
|
|
|
|
|
|
if is_end_of_chapters():
|
|
|
|
ending_route_number = get_ending()
|
|
|
|
next_ending_chapter()
|
2024-08-17 02:01:55 +02:00
|
|
|
# return
|
2024-08-09 00:19:48 +02:00
|
|
|
|
2024-08-12 04:13:20 +02:00
|
|
|
chapter_index += 1
|
2024-08-17 02:01:55 +02:00
|
|
|
current_general_chapter = general_chapters[chapter_index]
|
2024-08-12 04:13:20 +02:00
|
|
|
|
2024-08-17 02:01:55 +02:00
|
|
|
renpy.call(current_general_chapter)
|
2024-08-12 04:13:20 +02:00
|
|
|
|
2024-08-09 00:19:48 +02:00
|
|
|
|
|
|
|
def is_end_of_chapters():
|
|
|
|
return chapter_index >= chapters_array_length
|
|
|
|
|
|
|
|
|
|
|
|
def next_ending_chapter():
|
2024-08-17 02:01:55 +02:00
|
|
|
global ending_route_number
|
|
|
|
global ending_chapter_index
|
|
|
|
global current_ending_chapter
|
2024-08-09 00:19:48 +02:00
|
|
|
|
|
|
|
if ending_route_number in ending_routes:
|
|
|
|
# Save the ending chapters array from
|
|
|
|
# the ending_routes dictionary
|
2024-08-17 02:01:55 +02:00
|
|
|
current_ending_list: list[str] = ending_routes[ending_route_number]
|
|
|
|
|
|
|
|
reset_debug_scores()
|
2024-08-09 00:19:48 +02:00
|
|
|
|
|
|
|
if ending_chapter_index < len(current_ending_list):
|
|
|
|
# Stores the label name from the current_ending_list array in the item variable
|
2024-08-17 02:01:55 +02:00
|
|
|
current_ending_chapter = current_ending_list[ending_chapter_index]
|
|
|
|
# The item is assigned first and then increase the ending_chapter_index as it can't be done after using renpy.jump()
|
|
|
|
|
2024-08-09 00:19:48 +02:00
|
|
|
# Increases the index and jumps to the label
|
|
|
|
ending_chapter_index += 1
|
2024-08-17 02:01:55 +02:00
|
|
|
renpy.jump(current_ending_chapter)
|
2024-08-09 01:01:30 +02:00
|
|
|
else: # We've reached the end of the final chapters
|
|
|
|
ending_image()
|
|
|
|
renpy.call("lending")
|
2024-08-09 00:19:48 +02:00
|
|
|
else:
|
|
|
|
return
|
|
|
|
|
|
|
|
|
2024-08-17 02:01:55 +02:00
|
|
|
def reset_debug_scores():
|
|
|
|
global current_general_chapter
|
|
|
|
|
|
|
|
current_general_chapter = None
|
|
|
|
|
|
|
|
if config.developer and persistent.enable_debug_scores:
|
|
|
|
debug_story_variables(False)
|
|
|
|
debug_story_variables(True, True)
|
|
|
|
|
|
|
|
|
2024-08-09 03:42:08 +02:00
|
|
|
# label storyline:
|
|
|
|
# call chapter_1 from _call_chapter_1
|
|
|
|
# call chapter_2 from _call_chapter_2
|
|
|
|
# call chapter_3 from _call_chapter_3
|
|
|
|
# call chapter_4 from _call_chapter_4
|
|
|
|
# call chapter_5 from _call_chapter_5
|
|
|
|
# call chapter_6 from _call_chapter_6
|
|
|
|
# call chapter_7 from _call_chapter_7
|
|
|
|
# call chapter_8 from _call_chapter_8
|
|
|
|
# call chapter_9 from _call_chapter_9
|
|
|
|
# call chapter_10 from _call_chapter_10
|
|
|
|
# call chapter_11 from _call_chapter_11
|
|
|
|
# call get_ending from _call_get_ending_5
|
|
|
|
# if _return == 4:
|
|
|
|
# call chapter_11D from _call_chapter_11D
|
|
|
|
# call chapter_12D from _call_chapter_12D
|
|
|
|
# call chapter_12_5D from _call_chapter_12_5D
|
|
|
|
# call chapter_13D from _call_chapter_13D
|
|
|
|
# call chapter_14D from _call_chapter_14D
|
|
|
|
# elif _return == 3:
|
|
|
|
# call chapter_11C from _call_chapter_11C
|
|
|
|
# call chapter_12C from _call_chapter_12C
|
|
|
|
# call chapter_12_5C from _call_chapter_12_5C
|
|
|
|
# call chapter_13C from _call_chapter_13C
|
|
|
|
# call chapter_14C from _call_chapter_14C
|
|
|
|
# elif _return == 2:
|
|
|
|
# call chapter_11B from _call_chapter_11B
|
|
|
|
# call chapter_12B from _call_chapter_12B
|
|
|
|
# # no chapter_13 here since the scene is different enough to the other routes for everything to go into 13C
|
|
|
|
# call chapter_13B from _call_chapter_13B
|
|
|
|
# call chapter_14B from _call_chapter_14B
|
|
|
|
# else: # if all else fails, we just assume that we got Endings.Shooter
|
|
|
|
# call chapter_11A from _call_chapter_11A
|
|
|
|
# call chapter_12A from _call_chapter_12A
|
|
|
|
# call chapter_12_5D from _call_chapter_12_5D_1
|
|
|
|
# call chapter_13A from _call_chapter_13A
|
|
|
|
# call chapter_14A from _call_chapter_14A
|
|
|
|
# $ ending_image()
|
|
|
|
# $ renpy.quit()
|
|
|
|
# $ ending_image()
|
|
|
|
# call lending from _call_lending
|
|
|
|
# return
|