forked from Cavemanon/SnootGame
Modify storyline to extend the chapters array once the common chapters are finished
This commit is contained in:
@ -27,6 +27,8 @@ default ending_route_number = None
|
|||||||
default current_ending_chapter = None
|
default current_ending_chapter = None
|
||||||
default ending_chapter_index = 0
|
default ending_chapter_index = 0
|
||||||
|
|
||||||
|
default is_end_reached = False
|
||||||
|
|
||||||
|
|
||||||
init -1 python:
|
init -1 python:
|
||||||
def ending_image():
|
def ending_image():
|
||||||
@ -47,23 +49,37 @@ init python:
|
|||||||
global chapter_index
|
global chapter_index
|
||||||
global current_general_chapter
|
global current_general_chapter
|
||||||
global ending_route_number
|
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()
|
ending_route_number = get_ending()
|
||||||
reset_debug_scores()
|
add_ending_chapters()
|
||||||
next_ending_chapter()
|
is_end_reached = True
|
||||||
# return
|
|
||||||
|
if chapter_index < chapters_array_length:
|
||||||
chapter_index += 1
|
chapter_index += 1
|
||||||
current_general_chapter = general_chapters[chapter_index]
|
current_general_chapter = general_chapters[chapter_index]
|
||||||
|
renpy.call(current_general_chapter)
|
||||||
renpy.call(current_general_chapter)
|
else:
|
||||||
|
ending_image()
|
||||||
|
renpy.call("lending")
|
||||||
|
|
||||||
|
|
||||||
def is_end_of_chapters():
|
def is_end_of_chapters():
|
||||||
return chapter_index >= chapters_array_length
|
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():
|
def next_ending_chapter():
|
||||||
global ending_route_number
|
global ending_route_number
|
||||||
global ending_chapter_index
|
global ending_chapter_index
|
||||||
@ -88,8 +104,3 @@ init python:
|
|||||||
else:
|
else:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
def reset_debug_scores():
|
|
||||||
if config.developer and persistent.enable_debug_scores:
|
|
||||||
debug_story_variables(False)
|
|
||||||
debug_story_variables(True, True)
|
|
||||||
|
Reference in New Issue
Block a user