SnootGame/game/utility.rpy

56 lines
1.5 KiB
Text

## 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
# Chapter related variables
$ chapter_list_length = len(chapter_list) - 1
$ chapter_list_index = 0 # Index number for the current position of the chapter_list array
$ current_chapter = chapter_list[chapter_list_index] # Store the name of the label as a string
# Ending related variables
$ ending_route_number = None
$ is_end_reached = 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:
return 4 # Golden
elif anonscore >= 3 and fangscore <= 4:
return 3 # Tradwife
elif anonscore <= 3 and fangscore >= 3:
return 2 # Doomer
else:
return 1 # Shooter
def debug_story_variables(toggle=True):
var_list = [
"anonscore",
"fangscore",
"current_chapter",
"chapter_list_length",
"chapter_list_index",
"ending_route_number"
]
for item in var_list:
if toggle:
renpy.watch(item)
else:
renpy.unwatch(item)