Functions refactoring

This commit is contained in:
Iggy 2024-08-30 15:02:24 -03:00
parent 803e878c3f
commit a31fa50d8a
2 changed files with 8 additions and 9 deletions

View file

@ -58,9 +58,9 @@ init python:
find_chapter_in_array()
if not is_end_reached:
add_ending_chapters() # From storyline
add_ending_chapters(ending_route_number)
update_ending_variables() # From storyline
update_ending_variables() # Updates variables for newly extended 'chapter_list' with ending chapters
def set_scores(anon_score, fang_score):

View file

@ -13,7 +13,7 @@ init -1 python:
init python:
def next_story_chapter():
global chapter_list_index, current_chapter, ending_route_number
global chapter_list_index, current_chapter
# Add check "is_end_reached" to have this if statement be executed only once when finishing the general chapters
if not is_end_reached and chapter_list_index >= chapter_list_length:
@ -31,15 +31,15 @@ init python:
global ending_route_number
ending_route_number = get_ending()
add_ending_chapters()
update_ending_variables()
add_ending_chapters(ending_route_number)
update_ending_variables() # Updates variables for newly extended 'chapter_list' with ending chapters
def add_ending_chapters():
def add_ending_chapters(route_number):
global chapter_list
if ending_route_number in ending_routes:
chapter_list.extend(ending_routes[ending_route_number])
if route_number in ending_routes:
chapter_list.extend(ending_routes[route_number])
def update_ending_variables():
@ -55,7 +55,6 @@ init python:
return len(chapter_list) - 1
def end_story():
ending_image()
renpy.call("lending")