SnootGame/game/utility.rpy

32 lines
1.0 KiB
Plaintext

## Utility functions for game setup, debugging etc.
init python:
from enum import Enum
# Create compile-time macros to more easily track what ending goes to what without the need for magic numbers or strings that can be mistyped
class Endings(Enum):
Shooter = 0
Doomer = 1
Tradwife = 2
Golden = 3
label initstats(anon=0, fang=0):
# Sets various game-related global variables
# :param int anon: Anon's score
# :param int fang: Fang's score
$ anonscore = anon
$ fangscore = fang
return
label get_ending:
# To check what ending we're getting, call this label and then check the value of _return
# Sensible to have this logic defined in only one place for consistency
if anonscore >= 4 and fangscore >= 4 and wingStory:
return(Endings.Golden)
elif anonscore >= 3 and fangscore <=4:
return(Endings.Tradwife)
elif anonscore <= 3 and fangscore >=3:
return(Endings.Doomer)
else:
return(Endings.Shooter)