forked from Cavemanon/SnootGame
Compare commits
5 Commits
a65a5075fe
...
0fbff1b81b
Author | SHA1 | Date | |
---|---|---|---|
0fbff1b81b | |||
84ccfc1b13 | |||
b65ed32b14 | |||
c5ea9c9cb5 | |||
993824e152 |
27
game/chapter_variables.rpy
Normal file
27
game/chapter_variables.rpy
Normal file
@ -0,0 +1,27 @@
|
||||
# Store the general chapters inside an array for easy manipulation
|
||||
default chapter_list = [
|
||||
"chapter_1", "chapter_2", "chapter_3", "chapter_4", "chapter_5",
|
||||
"chapter_6", "chapter_7", "chapter_8", "chapter_9", "chapter_10", "chapter_11"
|
||||
]
|
||||
|
||||
define ending_routes = {
|
||||
4: ["chapter_11D", "chapter_12D", "chapter_12_5D", "chapter_13D", "chapter_14D"],
|
||||
3: ["chapter_11C", "chapter_12C", "chapter_12_5C", "chapter_13C", "chapter_14C"],
|
||||
2: ["chapter_11B", "chapter_12B", "chapter_13B", "chapter_14B"],
|
||||
1: ["chapter_11A", "chapter_12A", "chapter_12_5D", "chapter_13A", "chapter_14A"]
|
||||
}
|
||||
|
||||
# Anon/Fang
|
||||
default anonscore = 0
|
||||
default fangscore = 0
|
||||
default wingStory = False
|
||||
default lock_scores = False # Allows points to be increased
|
||||
|
||||
# Chapter variables
|
||||
default chapter_list_length = get_chapter_list_length()
|
||||
default chapter_list_index = 0 # Index number for the current position of the chapter_list array
|
||||
default current_chapter = chapter_list[chapter_list_index] # Store the name of the label as a string
|
||||
|
||||
# Ending variables
|
||||
default ending_route_number = None
|
||||
default is_end_reached = False
|
@ -323,7 +323,7 @@ transform scloserleft:
|
||||
|
||||
label start:
|
||||
|
||||
call initstats(anon = 0, fang = 0) from _call_initstats
|
||||
$ toggle_debug()
|
||||
|
||||
pause 1.0
|
||||
|
||||
|
@ -26,30 +26,50 @@ default selected_tuple = None
|
||||
init python:
|
||||
|
||||
def select_chapter():
|
||||
global selected_tuple, current_chapter
|
||||
global selected_tuple, current_chapter, is_end_reached
|
||||
|
||||
while True:
|
||||
selected_tuple = renpy.display_menu(tuples_index + [("Go Back", "go_back")])
|
||||
selected_tuple = display_tuple_menu(tuples_index)
|
||||
if selected_tuple == "go_back":
|
||||
renpy.jump("chapter_select")
|
||||
|
||||
current_chapter = renpy.display_menu(selected_tuple + [("Go Back", "go_back")])
|
||||
current_chapter = display_tuple_menu(selected_tuple)
|
||||
if current_chapter == "go_back":
|
||||
continue
|
||||
else:
|
||||
break
|
||||
|
||||
set_stats()
|
||||
toggle_debug()
|
||||
|
||||
renpy.call(current_chapter)
|
||||
|
||||
|
||||
def display_tuple_menu(options):
|
||||
return renpy.display_menu(options + [("Go Back", "go_back")])
|
||||
|
||||
|
||||
def set_stats():
|
||||
global chapter_list_length, chapter_list_index, ending_route_number, is_end_reached
|
||||
global chapter_list_length, ending_route_number, is_end_reached, lock_scores
|
||||
|
||||
chapter_list_length = len(chapter_list) - 1
|
||||
# chapter_list_length = get_chapter_list_length()
|
||||
ending_route_number = get_ending()
|
||||
|
||||
lock_scores = True # Prevents scores from increasing when using the chapter selection tool
|
||||
|
||||
find_chapter_in_array()
|
||||
|
||||
if not is_end_reached:
|
||||
add_ending_chapters() # From storyline
|
||||
|
||||
update_ending_variables() # From storyline
|
||||
|
||||
renpy.call(current_chapter)
|
||||
|
||||
def set_scores(anon_score, fang_score):
|
||||
global anonscore, fangscore
|
||||
|
||||
anonscore = anon_score
|
||||
fangscore = fang_score
|
||||
|
||||
|
||||
def find_chapter_in_array():
|
||||
@ -62,36 +82,41 @@ init python:
|
||||
current_chapter = ""
|
||||
|
||||
|
||||
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"
|
||||
]
|
||||
return
|
||||
|
||||
|
||||
label chapter_select:
|
||||
scene black
|
||||
stop sound
|
||||
stop music
|
||||
stop music fadeout 2
|
||||
scene black with dissolve
|
||||
|
||||
menu:
|
||||
"Initialize scores:"
|
||||
|
||||
"Ending 1":
|
||||
$ anon_score = 0
|
||||
$ fang_score = 0
|
||||
$ ending_route_number = 1
|
||||
$ set_scores(0, 0)
|
||||
"Ending 2":
|
||||
$ anon_score = 0
|
||||
$ fang_score = 4
|
||||
$ ending_route_number = 2
|
||||
$ set_scores(0, 4)
|
||||
"Ending 3":
|
||||
$ anon_score = 4
|
||||
$ fang_score = 0
|
||||
$ ending_route_number = 3
|
||||
$ set_scores(4, 0)
|
||||
"Ending 4":
|
||||
$ anon_score = 4
|
||||
$ fang_score = 4
|
||||
$ ending_route_number = 4
|
||||
$ set_scores(4, 4)
|
||||
"Exit to main menu":
|
||||
scene black with dissolve
|
||||
return
|
||||
|
||||
$ lock_scores = True
|
||||
call initstats(anon_score, fang_score) from _call_initstats_2
|
||||
|
||||
$ is_end_reached = False # Reset this for when the tool is used more than once
|
||||
|
||||
window hide
|
||||
|
||||
if not is_end_reached:
|
||||
call reset_chapter_list from _call_reset_chapter_list
|
||||
|
||||
$ select_chapter()
|
||||
|
||||
|
@ -1,26 +1,3 @@
|
||||
# Store the general chapters inside an array for easy manipulation
|
||||
default chapter_list = [
|
||||
"chapter_1", "chapter_2", "chapter_3", "chapter_4", "chapter_5",
|
||||
"chapter_6", "chapter_7", "chapter_8", "chapter_9", "chapter_10", "chapter_11"
|
||||
]
|
||||
|
||||
define ending_routes = {
|
||||
4: ["chapter_11D", "chapter_12D", "chapter_12_5D", "chapter_13D", "chapter_14D"],
|
||||
3: ["chapter_11C", "chapter_12C", "chapter_12_5C", "chapter_13C", "chapter_14C"],
|
||||
2: ["chapter_11B", "chapter_12B", "chapter_13B", "chapter_14B"],
|
||||
1: ["chapter_11A", "chapter_12A", "chapter_12_5D", "chapter_13A", "chapter_14A"]
|
||||
}
|
||||
|
||||
# Chapter related variables
|
||||
default chapter_list_length = len(chapter_list) - 1
|
||||
default chapter_list_index = 0 # Index number for the current position of the chapter_list array
|
||||
default current_chapter = chapter_list[chapter_list_index] # Store the name of the label as a string
|
||||
|
||||
# Ending related variables
|
||||
default ending_route_number = None
|
||||
default is_end_reached = False # consider moving variables out of here
|
||||
|
||||
|
||||
init -1 python:
|
||||
def ending_image():
|
||||
#0b0000, DCBA, flash the bits with |=, check with &
|
||||
@ -35,7 +12,7 @@ init -1 python:
|
||||
|
||||
|
||||
init python:
|
||||
# test comment
|
||||
|
||||
def next_story_chapter():
|
||||
global chapter_list_index, current_chapter, ending_route_number
|
||||
|
||||
@ -67,7 +44,7 @@ init python:
|
||||
global chapter_list
|
||||
|
||||
if ending_route_number in ending_routes:
|
||||
chapter_list.extend(ending_routes[ending_route_number])
|
||||
chapter_list.extend(ending_routes[ending_route_number])
|
||||
|
||||
|
||||
def update_ending_variables():
|
||||
@ -75,10 +52,15 @@ init python:
|
||||
global is_end_reached
|
||||
|
||||
# chapter_list_length is updated to reflect the addition to the chapter_list array
|
||||
chapter_list_length = len(chapter_list) - 1
|
||||
chapter_list_length = get_chapter_list_length()
|
||||
is_end_reached = True
|
||||
|
||||
|
||||
def get_chapter_list_length():
|
||||
return len(chapter_list) - 1
|
||||
|
||||
|
||||
|
||||
def end_story():
|
||||
ending_image()
|
||||
renpy.call("lending")
|
||||
|
@ -1,21 +1,5 @@
|
||||
## Utility functions for game setup, debugging etc.
|
||||
|
||||
label initstats(anon=0, fang=0):
|
||||
# Sets various game-related global variables
|
||||
# :param int anon: Anon's score
|
||||
# :param int fang: Fang's score
|
||||
# :param bool trad: Tradwife ending flag
|
||||
$ anonscore = anon
|
||||
$ fangscore = fang
|
||||
$ wingStory = False
|
||||
|
||||
if persistent.enable_debug_scores:
|
||||
$ debug_story_variables(False)
|
||||
$ debug_story_variables(True)
|
||||
|
||||
return
|
||||
|
||||
|
||||
init python:
|
||||
def get_ending():
|
||||
if anonscore >= 4 and fangscore >= 4 and wingStory:
|
||||
@ -35,7 +19,8 @@ init python:
|
||||
"current_chapter",
|
||||
"chapter_list_length",
|
||||
"chapter_list_index",
|
||||
"ending_route_number"
|
||||
"ending_route_number",
|
||||
"is_end_reached"
|
||||
]
|
||||
|
||||
for item in var_list:
|
||||
@ -58,4 +43,10 @@ init python:
|
||||
if not lock_scores:
|
||||
fangscore += 1
|
||||
|
||||
|
||||
def toggle_debug():
|
||||
if persistent.enable_debug_scores:
|
||||
debug_story_variables(False)
|
||||
debug_story_variables(True)
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user