Modify storyline to extend the chapters array once the common chapters are finished

This commit is contained in:
Iggy 2024-08-18 21:06:13 -03:00
parent 01e9ababa2
commit ba0024f251

View file

@ -27,6 +27,8 @@ default ending_route_number = None
default current_ending_chapter = None
default ending_chapter_index = 0
default is_end_reached = False
init -1 python:
def ending_image():
@ -47,23 +49,37 @@ init python:
global chapter_index
global current_general_chapter
global ending_route_number
global is_end_reached
if is_end_of_chapters():
if not is_end_reached and is_end_of_chapters():
ending_route_number = get_ending()
reset_debug_scores()
next_ending_chapter()
# return
chapter_index += 1
current_general_chapter = general_chapters[chapter_index]
renpy.call(current_general_chapter)
add_ending_chapters()
is_end_reached = True
if chapter_index < chapters_array_length:
chapter_index += 1
current_general_chapter = general_chapters[chapter_index]
renpy.call(current_general_chapter)
else:
ending_image()
renpy.call("lending")
def is_end_of_chapters():
return chapter_index >= chapters_array_length
def add_ending_chapters():
global general_chapters
global chapters_array_length
if ending_route_number in ending_routes:
general_chapters.extend(ending_routes[ending_route_number])
chapters_array_length = len(general_chapters) - 1
# renpy.block_rollback() BLOQUEAR O CAMBIARLO A TUPLE
general_chapters = tuple(general_chapters)
def next_ending_chapter():
global ending_route_number
global ending_chapter_index
@ -88,8 +104,3 @@ init python:
else:
return
def reset_debug_scores():
if config.developer and persistent.enable_debug_scores:
debug_story_variables(False)
debug_story_variables(True, True)