mirror of
https://git.cavemanon.xyz/Cavemanon/SnootGame.git
synced 2025-03-25 03:14:51 +01:00
Functions refactoring
This commit is contained in:
parent
803e878c3f
commit
a31fa50d8a
2 changed files with 8 additions and 9 deletions
|
@ -58,9 +58,9 @@ init python:
|
||||||
find_chapter_in_array()
|
find_chapter_in_array()
|
||||||
|
|
||||||
if not is_end_reached:
|
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):
|
def set_scores(anon_score, fang_score):
|
||||||
|
|
|
@ -13,7 +13,7 @@ init -1 python:
|
||||||
|
|
||||||
init python:
|
init python:
|
||||||
def next_story_chapter():
|
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
|
# 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:
|
if not is_end_reached and chapter_list_index >= chapter_list_length:
|
||||||
|
@ -31,15 +31,15 @@ init python:
|
||||||
global ending_route_number
|
global ending_route_number
|
||||||
|
|
||||||
ending_route_number = get_ending()
|
ending_route_number = get_ending()
|
||||||
add_ending_chapters()
|
add_ending_chapters(ending_route_number)
|
||||||
update_ending_variables()
|
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
|
global chapter_list
|
||||||
|
|
||||||
if ending_route_number in ending_routes:
|
if route_number in ending_routes:
|
||||||
chapter_list.extend(ending_routes[ending_route_number])
|
chapter_list.extend(ending_routes[route_number])
|
||||||
|
|
||||||
|
|
||||||
def update_ending_variables():
|
def update_ending_variables():
|
||||||
|
@ -55,7 +55,6 @@ init python:
|
||||||
return len(chapter_list) - 1
|
return len(chapter_list) - 1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def end_story():
|
def end_story():
|
||||||
ending_image()
|
ending_image()
|
||||||
renpy.call("lending")
|
renpy.call("lending")
|
||||||
|
|
Loading…
Add table
Reference in a new issue