Files
SnootGame/game/src/chapter_select.rpy

175 lines
4.4 KiB
Plaintext

define chapter_tuple_1 = [
("1. Anon meets Fang.", "chapter_1"),
("2. Fourth day of school.", "chapter_2"),
("3. Showing up at band practice.", "chapter_3"),
("4. Anon needs help during music period.", "chapter_4"),
("5. Fang and Anon cut class to talk on the roof.", "chapter_5"),
("6. Anon helps Fang find a venue for the band.", "chapter_6")
]
define chapter_tuple_2 = [
("7. Concert day.", "chapter_7"),
("8. Anon and Fang study together.", "chapter_8"),
("9. Trish ridicules Anon in front of the school.", "chapter_9"),
("10. Fang goes to Anon's apartment.", "chapter_10"),
("11. School assignment and route lock.", "chapter_11")
]
define ending_1_tuple = [
("11A. ", "chapter_11A"),
("12A. ", "chapter_12A"),
("12_5D. ", "chapter_12_5D"),
("13A. ", "chapter_13A"),
("14A. ", "chapter_14A")
]
define ending_2_tuple = [
("11B. ", "chapter_11B"),
("12B. ", "chapter_12B"),
("13B. ", "chapter_13B"),
("14B. ", "chapter_14B")
]
define ending_3_tuple = [
("11C. ", "chapter_11C"),
("12C. ", "chapter_12C"),
("12_5C. ", "chapter_12_5C"),
("13C. ", "chapter_13C"),
("14C. ", "chapter_14C")
]
define ending_4_tuple = [
("11D. ", "chapter_11D"),
("12D. ", "chapter_12D"),
("12_5D. ", "chapter_12_5D"),
("13D. ", "chapter_13D"),
("14D. ", "chapter_14D")
]
default tuples_index = [
("Chapters 1 to 6", chapter_tuple_1),
("Chapters 7 to 11", chapter_tuple_2)
]
init python:
def select_chapter():
global current_chapter, quick_menu
selected_tuple = ()
while True:
selected_tuple = display_tuple_menu(tuples_index)
if selected_tuple == "go_back":
renpy.jump("chapter_select")
current_chapter = display_tuple_menu(selected_tuple)
find_chapter_in_array()
if current_chapter == "go_back":
continue
else:
break
set_stats()
toggle_debug()
quick_menu = True # Restores the bottom quick menu UI
renpy.call(current_chapter)
def add_ending_tuple(ending_number):
global tuples_index
ending_tuples = {
1: ending_1_tuple,
2: ending_2_tuple,
3: ending_3_tuple,
4: ending_4_tuple
}
if ending_number in ending_tuples:
description = f"Ending {ending_number} chapters"
tuples_index.append((description, ending_tuples[ending_number]))
def display_tuple_menu(options):
return renpy.display_menu(options + [("Go Back", "go_back")])
def set_stats():
update_ending_variables() # Updates variables for newly extended 'chapter_list' with ending chapters
def set_scores(anon_score, fang_score):
global anonscore, fangscore
anonscore = anon_score
fangscore = fang_score
def find_chapter_in_array():
global chapter_list_index, current_chapter
try:
chapter_list_index = chapter_list.index(current_chapter)
except ValueError:
chapter_list_index = -1
current_chapter = "hola"
label reset_chapter_list:
$ chapter_list = [
"chapter_1", "chapter_2", "chapter_3", "chapter_4", "chapter_5",
"chapter_6", "chapter_7", "chapter_8", "chapter_9", "chapter_10", "chapter_11"
]
$ tuples_index = [
("Chapters 1 to 6", chapter_tuple_1),
("Chapters 7 to 11", chapter_tuple_2)
]
return
label chapter_select:
$ quick_menu = False # Hides bottom quick menu UI
call reset_chapter_list from _call_reset_chapter_list
$ anon_points = 0
$ fang_points = 0
stop sound
stop music fadeout 2
scene black with dissolve
menu:
"Initialize scores:"
"Ending 1":
pass # Since points are already initialized at 0
"Ending 2":
# anon 0
$ fang_points = 4
"Ending 3":
$ anon_points = 4
# fang 0
"Ending 4":
$ anon_points = 4
$ fang_points = 4
"Exit to main menu":
scene black with dissolve
return
$ set_scores(anon_points, fang_points)
$ ending_route_number = get_ending()
$ add_ending_chapters(ending_route_number)
$ add_ending_tuple(ending_route_number)
window hide
$ select_chapter()