-
Notifications
You must be signed in to change notification settings - Fork 683
Init Pipeline
This page will be explanation of all the init levels we use in MAS, which should act as a helpful timeline of startup events.
Init levels go from -999 -> 999. It is possible to use levels lower or higher than the limits, but renpy advises not to.
Python early is even before -999, and happens before persistent
is loaded.
In general:
-
Event
framework created in early. - Logging can be done after -990.
-
persistent
s are backed up at -900. - DelayedActions can be built after -880.
- Pre-adding DelayedActions can happen after -880.
- DelayedAction creation functions need to be defined before -875
- Historical data saving happens at -800.
- The lock db can be used after -500.
- Docking Station can be used after -45.
- Affection's numerical value can be loaded after -10.
- Monika images can be built after -5.
- All topics are created at 5.
- Update migration mapping is setup at 9.
- Update scripts run at 10.
- Affection functions can be used after 20.
- Selectable data is loaded from persistent at 200.
- Images are built at 500.
- Overlays can be hidden/shown/enabled/disabled after 501.
- Piano JSONS are loaded at 800.
- DelayedAction runtime map is loaded at 994.
- Init-stage DelayedActions are run at 995.
- Late update scripts are run at 999.
- early
- -999
- -990
- -900
- -880
- -875
- -876
- -860
- -850
- -816
- -815
- -810
- -800
- -750
- -600
- -500
- -100
- -45
- -20
- -11
- -10
- -5
- -4
- -3
- -2
- -1
- 0
- 1
- 2
- 4
- 5
- 9
- 10
- 11
- 15
- 20
- 100
- 101
- 200
- 205
- 500
- 501
- 790
- 800
- 810
- 850
- 899
- 900
- 970
- 994
- 995
- 999
Now for the actual init levels.
The Event
, MASButtonDisplayable
, MASQuipList
and MASMailbox
classes are defined here.
Also basically the Event framework.
singleton
datetime
-
MAS_MONIKA_Z
- zorder for monika display -
MAS_BACKGROUND_Z
- zorder for bg display -
EV_ACT*
- EV action constants + list of those constants
-
Event
- core class that represents basically every topic -
MASButtonDisplayable
- core displayable that can act as a button in custom displayables -
MASQuipList
- quip manager class for easy quip management. Not used often, but can do random label launching nicely -
MASMailbox
- async communication helper for comms between objects. Users should extend this rather than use directly.
Flowcheck (FC) constants are defined here
-
MAS_FC_*
- flowcheck constants and list of them for DelayedAction framework
Does persistent checks and disables backup system if necessary.
sets not_finite_loop
checking to 120 seconds instead of 60.
Also creates the log folder if it doesn't exist.
os
Core utility functions are defined here
store
os
shutil
datetime
-
clean_gui_text
- cleans gui text by removing key symbols -
tryparseint
- attempts to parse a value into an int -
copyfile
- copies files from one location to another -
writelog
- writes messages to mas log -
trydel
- attempts to delete a file at a path -
logrotate
- does a log rotation for a given log -
tryparsedt
- attempts to parse a string into a datetime -
trywrite
- attempts to write a file
Runs the persistent
backup system. All code here is not intended for runtime usage.
- os
- mas_utils
Initializes image checksums and file maps for decoding images at runtime
os
Sets up the MASDelayedAction
framework core.
-
persistent._mas_delayed_action_list
- static list ofMASDelayedAction
ids. initialized if None -
mas_delayed_action_map
- runtime map ofMASDelayedActions
-
MASDelayedAction
- class used for the DelayedAction framework
-
mas_removeDelayedAction
- functions used for removing/dequeing DelayedActions -
mas_runDelayedAction
- attempts to run DelayedActions -
mas_addDelayedAction
- functions used for adding/queueing DelayedActions
Declares a special function for adding MASDelayedAction
ids early in the pipeline.
store
-
_MDA_safeadd
- special function for early adding ofMASDelayedAction
. Normal users should use the approved add/remove functions instead of this.
In general, all MASDelayedAction
constructor functions are built here.
Contains MASDelayedAction
constructor functions for greetings
Contains MASDelayedAction
constructor functions for the islands event
Contains MASDelayedAction
constructor functions for the bday events. Also contains the action callables for those MASDelayedActions
.
Contains a map mapping MASDelayedAction
creation functions to IDs.
Because of this, all MASDelayedAction
creation functions need to be created before this init level.
Declares main history saver functions and constants, as well as some persistents
store
datetime
-
L_FOUND
- found data in the archives -
L_NO_YEAR
- did not find year in the archives -
L_NO_KEY
- did not find key in the archives
-
addMHS
- adds aMASHistorySaver
object to the database. -
getMHS
- retrieves aMASHistorySaver
object based on ID
Declares public history saver functions and the main class
-
MASHistorySaver
- history saving object that automates data migration as well as other things
-
mas_HistLookup
- looks up data in the archives -
mas_HistLookup_ot
- looks up data in the archives, over multiple years -
mas_HistLookup_otl
- looks up data in the archives, given a list of years -
mas_HistVerify
- checks if some data matches what was stored in the archives at one point. (checks multiple years)
MASDelayedAction
callbacks can be defined here, but it's better to define them closer to where they are needed.
Where programming points for MASHistorySaver
objects can be defined.
-
_MDA_safeadd
frommas_delact
Most MASHistorySaver
objects are created here.
Creates the MASHistorySaver
object for o31.
Creates the MASHistorySaver
object for player model variables and bday.
Runs the MASHistorySaver
algorithm.
Declares the MASAsyncWrapper
class
threading
-
MASAsyncWrapper
- class that does nicely abstracted multithreading / async functions
- store
Initializes the LOCK DB portion of the Event
framework.
-
mas_init_lockdb_template
- lockdb template (designed to be modified when adding properties) -
persistent._mas_event_init_lockdb
- actual database for lock data. Initialized if None -
persistent._mas_event_init_lockdb_template
- stored lockdb template (used to check if properties have been added to the Event framework) -
Event.INIT_LOCKDB
- sets this to the lock database
initializes key dockstat constants
-
blocksize
- irl blocksize we should be using for any file I/O -
b64_blocksize
- irl blocksize we should be using for file I/O with base64 encoded files -
MAS_PKG_*
- monika status constants -
MAS_SBD_*
- monika surprise party constants
Initializes utility functions, mainly ones not needed super early
datetime
ctypes
random
cStringIO.StringIO
-
tryparsefloat
- attempts parsing a value into a float -
add_years
- date adjusting function -
add_months
- date adjusting function -
sod
- takes a datetime object and returns it with time set to the "start of day" -
mdnt
- takes a datetime object and returns it with time set to midnight -
am3
- takes a datetime object and returns it with time set to 3am -
randomblob
- generates a random blob of data in a StringIO buffer -
log_entry
- logs historical entries into the given log
checks if the DDLC archives are in the game folder.
Initializes the DockingStation framework.
os
-
mas_docking_station
- instance ofMASDockingStation
, centered around the characters folder
-
MASDockingStation
- class designed for easy base64 file i/o + checksums. (think giving files and taking monika out)
Declares selectable classes.
-
MASSelectableAccessory
- Selectable class for accessories -
MASSelectableHair
- Selectable class for hair -
MASSelectableClothes
- Selectable class for clothes
Sets up the o31 event vars and image decoder
store
mas_dockstat
mas_ics
-
o31_cg_station
- MASDockingStation instance centered around the o31 cg folder -
o31_cg_decoded
- True if we decoded the cg, False otherwise -
mas_return_from_tt
- True if we just returned from the Trick/Treat farewell
-
decodeImage
- decodes a specific cg image -
removeImages
- removes all cg images -
isMonikaInCostume
- True if monika is in costume, False otherwise -
isTTGreeting
- True if we have a greeting type associated with a Trick/Treat farewell
Sets up the island event image decoder function
store
mas_dockstat
mas_ics
-
islands_station
- MASDockingStation instance centered around the islands folder
-
decodeImages
- decodes island images -
removeImages
- removes island images
sets up image decoder functions
mas_utils
-
decodeImages
- generic image decoder -
removeImages
- generic image remover
Declares affection loading/saving functions.
Decodes images.
- mas_cannot_decode_images - True if we failed to decode the images, False otherwise
sets up some flags used by the updater. these things are mostly legacy for updating from super old versions.
- found_monik_ani - True means
persistent
.monika_anniversary is set. super old - no_topics_list - True means we dont have the old random topics list. not really important anymore.
calendar constants
- CAL_TYPE_* - calendar Event types
state vars for enabling certain functions
- allow_dismiss - True enables dismissing, False disables
- allowdismiss - returns state of allow_dismiss
Declares selection screen constants and functions, and the selectable mailbox class
store
mas_utils
-
MB_DISP
- display text mailbox constant -
MB_DISP_DEF
- default display text mailbox constant -
MB_CONF
- confirm flag enable mailbox constant -
SELECT_ACS
- accessory selection type constant -
SELECT_HAIR
- hair selection type constant -
SELECT_CLOTH
- clothes selection type constant
-
ACS_SEL_MAP
- accessory selectables map -
ACS_SEL_SL
- accessory selectables sorted list -
HAIR_SEL_MAP
- hair selectables map -
HAIR_SEL_SL
- hair selectables sorted list -
CLOTH_SEL_MAP
- clothes selectables map -
CLOTH_SEL_SL
- clothes selectables sorted list
-
init_selectable_acs
- ints a selectable for an accessory. -
init_selectable_clothes
- inits a selectable for clothes -
init_selectable_hair
- inits a selectable for hair -
save_selectables
- saves selectable data to persistent -
load_selectables
- loads selectable data from persistent -
get_sel_acs
- gets the selectable for an accessory -
get_sel_clothes
- gets the selectable for clothes -
get_sel_hair
- gets the selectable for hair -
lock_acs
- locks selectable for an accessory -
lock_clothes
- locks selectable for clothes -
lock_hair
- locks selectable for hair -
unlock_acs
- unlocks selectable for an accessory -
unlock_clothes
- unlocks selectable for clothes -
unlock_hair
- unlocks selectable for hair
-
MASSelectableSpriteMailbox
- mailbox specific to selection screen mechanics
only one thing. the image existence checker
- getCharacterImage - retrieves the Displayable of a character + expression
Declares all the functions and constants used for DynamicDisplayable creation
NOTE: There are lots of constants here. Only including the ones that might need to be changed often.
-
POSES
- list of non-leaning poses -
L_POSES
- list of leaning poses
-
lean_acs_blacklist
- list of accessories that should disable leaning
NOTE: there are lots of image generation functions here. Only including functions that might be used outside of here.
-
init_acs
- initializes an accessory for later use. required for all accessories -
init_hair
- initalizes a hairstyle for later use. required for all hairstyles -
init_clothes_
- initializes clothes for later use. required for all clothes -
tryparsehair
- checks if the given hair string exists -
tryparseclothes
- checks if the given clothes string exists
initializes some poemgame classes and functions
- MASPoemWord - version of PoemWord that includes Monika
- MASPoemWordList - encapsulates MASPoemWords into a list
- glitchWord - glitches the given text with odds for space / unicode. better to use giltchtext for fully glitched text.
initializes lots of backing framework for the piano game + menus
- pygame
- os
NOTE: contains a huge amount of constants. None are really useful outside of piano. Only going to mention somewhat important ones here.
- NOTE_SIZE - controls how many notes are played before we try matching when not in SONG_MODE
- log - log purely for piano keys. Dont use unless its piano related.
- pnml_db - PianoNoteMatchList main database. Used to show what songs can be played
- pnml_bk_db - PianoNoteMatchList backup database. Used for song matching in freestyle.
- PianoNoteMatch - represents a note phrase + lyrics in piano
- PianoNoteMatchList - represents a list of PianoNoteMatches (aka a song) in piano
NOTE: contains a huge amount of functions needed for JSON converting. None are useful outside of piano.
Initializes topic-related constants and helper functions
- S_MOST_SEEN - percentage of seen topics. used in calculations for dividing topics into the seen groups. think of this as a percentage of the collection.
- S_TOP_SEEN - percentage of seen topics considered to be the most often seen. used in calculations for dividing topics into seen groups. think of this as an upper percentile.
- S_TOP_LIMIT - if the percentage of topics that fall under S_TOP_SEEN percentile is greater than this amount, then we use the S_MOST_SEEN percentage in dividing topics into seen groups.
- UNSEEN - chance out of 100 that we select an unseen topic
- SEEN - chance out of 100 that we select an already seen topic
- MOST_SEEN - chance out of 100 that we select a topic that has is considered over-seen
Initializes MASMonika character object for hair/clothing/acs framework
math
-
namedtuple
(UNUSED)
-
MASMonika
- represents Monika's clothes and hair and accessories -
MASPoseMap
- helper class for mapping poses to images. -
MASSpriteBase
- base class for all object-represented sprite sets -
MASSpriteFallbackBase
- base class for all object-represented sprite sets that can useMASPoseMap
as a fallback system -
MASAccessory
- class representation of an accessory -
MASHair
- class representation of a hairstyle -
MASClothes
- class representation of clothes
-
mas_drawmonika
- drawing function used for DynamicDisplayables
Programming points for sprites
store
Poemgame-related functions initalized here Everything here is suitable only for the poemgame, so not going to mention them here.
contains very powerful functions. not for the faint of heart
- glitchtext - copy of the existing glitchtext function. This was before I knew about
store
- mangleFile - mangles a file by messing with its bytes
- resetPlayerData - resets
persistent
data. pretty dangerous
basically 4 billion startup-related stuff. Mostly small things that dont go anywhere else. Also is where some base keymap stuff is set (not custom keymaps).
datetime
os
-
get_procs
- retreives list of running processes if on windows -
is_running
- checks if a process in the given list of process names is currently running -
is_file_present
- checks if a file is present -
mas_cvToHM
- converts minutes into hour / minutes -
mas_isSTtoAny
- checks if a time object is within a suntime amount and an hour / minute amount -
mas_isSRtoAny
- checks if a time object is within sunrise and an hour / minute amount -
mas_isSStoAny
- checks if a time object is within sunset and an hour / minute amount -
mas_isAnytoST
- checks if a time object is within an hour / minute amount and a suntime amount -
mas_isAnytoSR
- checks if a time object is within an hour / minute amount and sunrise -
mas_isAnytoSS
- checks if a time object is within an hour / minute amount and sunset -
mas_isMNtoSR
- checks if a time object is wtihin midnight to sunrise -
mas_isSRtoN
- checks if a time object is within sunrise to noon -
mas_isNtoSS
- checks if a time object is within noon to sunset -
mas_isSStoMN
- checks if a time object is within sunset to midnight -
mas_isSunny
- checks if a time object is within sunrise to sunset -
mas_isNight
- checks if a time object is not within sunrise to sunset -
mas_cvToDHM
- converts miniutes into a displayable form of hour / minutes -
get_pos
- gets position of currently playing music -
delete_all_saves
- deletes all saved games. (basically useless) -
delete_character
- deletes a character file. (basically useless) -
pause
- seems to be a variant of pause? unsure of usage -
enumerate_steam
- returns installed Steam IDs from a steam install. Untested, unused, probably buggy
Event menu constants and key functions. also contains some Event
databases
- store
- namedtuple
- datetime
- LAST_SEEN_DELTA - time delta used for determining if a topic has been seen recently
- RESTART_BLKLST - list of topics that should NOT be pushed to the event stack on a restart if they were interrupted.
- event_database -
Event
database of main topics (random + pool) - farewell_database -
Event
database of farewells - greeting_database -
Event
database of greetings
- addIfNew - adds items to a list of they are not in there already
- tuplizeEventLabelList - takes a list of keys and an
Event
database and returns a (prompt, label) list suitable for menu displaying - internalized versions of isFuture/isPresent/isPast (Event date comparison functions)
- internalized versions of hideEvent*/lockEvent*/unlockEvent* (Easy Event hiding / locking / unlocking functions)
Initialzes static classes used for creating rule tuples for Event
s
- datetime
- mas_utils
- EV_RULE* - rule type identifiers for the rule dicts in Event objects
- EV_NUM* - numerical repeat rule constants + list of them
- MASNumericalRepeatRule - creates / modifies / checks numerical repeat rules. aka repeat every x days/weeks/months/year
- MASSelectiveRepeatRule - creates / modifies / checks selective repeat rules. aka repeat when today matches this date/time criteria
- MASGreetingRule - creates / modifies / checks greeting rules. These are for deciding random chance of a greeting and/or should skip visuals
- MASFarewellRule - creates / modifies / checks farewell rules. These are for deciding random chance of a farewell
- MASAffectionRule - creates / modifies/ checks affection rules. These are used to determine if greetings/farewells should be shown NOT UNLOCKED
Contains some label constants for pong. Nothing here would be useful outside of pong. These are mainly to help with label replacing API, but this is a bad idea for efficiency, so probably dont follow this paradigm. There is a renpy-native way of label mapping/replacing, so we should use that for api purposes.
layout vars for the confirm quit popup, screens, and screen styles NOTE: screens and styles here are done via init_offset rules
- layout.QUIT_YES - message shown when user hits yes to the confirm quit popup
- layout.QUIT_NO - message shown when user hits no to the confirm quit popup
NOTE: a large amount of styles. Not going to put them here.
NOTE: large amount of screens here. Only going to mention the custom / important ones.
- preferences - this is where we add custom settings
- twopane_scrollable_menu - the double paned scrollable menu, used int he Talk menu
- scrollable_menu - single paned scrollable menu. Not generalized, so dont use this
- mas_gen_scrollable_menu - generalized scrollable menu. Use this
- mas_background_timed_jump - screen used to do timed menus
- mas_generic_restart - a very generic retart menu. forgot what this is for
- PauseDisplayable - custom Displayable that acts as a much better pause
constants and core functions for the Affection system, as well as setting up the audit log
- os
- datetime
- mas_utils
- store
NOTE: too many constants here. Most are state-related and/or contain the thresholds for different states. Only listing the important order lists / maps here.
- _aff_order - affection states in the "natural order" of affection, from lowest to highest
- _aff_cascade_map - affection states in a map that routes an affection state to the next state closest to NORMAL
- _affg_order - affection group states in the "natural order" of affection, from lowest to highest
- _affg_cascade_map - affection group states in a map that routes an affection group to the next group state cloest to G_NORMAL
- audit - function for affection change auditing
Declares helper anniversary build functions
NOTE: contains a pointer copy to persistent
- evhand
- mas_calendar
- mas_utils
- datetime
- build_anni - builds an anniversary date using the first_session datetime and the given advancers
- build_anni_end - same as build_anni, except gets the ending datetime of an anniversary
Meant to initalize globals. not really used though.
-
dlg_workflow
- True if we are in the middle of dialogue, False otherwise -
show_vignette
- True if we should show the vignette mask everywhere, False means do not show -
show_lightning
- True if we should show lightning during idle, False means do not show -
lightning_chance
- 1 out of x chance that lightning will show during idle -
lightning_s_chance
- 1 out of x chance that the sayori lightning egg will show during idle
initializes compliment menu constants, the compliment database, and compliment quips
- compliment_database -
Event
database of compliments - thanking_quips - single line quips used to thank player for compliments
Sets up the farewell selection function
- selectFarewell - selects the farewell to use. This does a bunch of algorithm stuff.
Sets up greeting types and the greeting selection function
- TYPE_* - greeting type constants
- selectGreeting - selects a greeting to use. This does a bunch of algorithm stuff
Not sure why this is here.
- mas_affection
mood constants / database / functions
- TYPE_* - mood types
- mood_db -
Event
database for moods
- getMoodType - gets the mood type for a given mood label
Creates the console for python teaching
- mas_utils
NOTE: all constants in here are purely for the console. No usage outside of this store.
- clr_cn - short variation of clear console function
- ex_cn - short variation of exit console function
- rst_cn - short variation of restart console function
- w_cmd - short variation of write command function
- x_cmd - short variation of execute command function
- wx_cmd - does both writing and executing of a command
- write_command - writes a command to the console. Does NOT execute
- clear_console - clears the console history and the current line
- restart_console - clears console history, current line, also displays the version text
- exit_console - disables the console
- exec_command - executes the currently written command. like pressing Enter
- get_last_line - gets last line from console history
story constants and database
- story_database -
Event
database of stories
functions core to the topic selection algorithm. Also seeds random.
- random
- songs
- evhand
- remove_seen_labels - removes labels that have already been seen from the given list
- mas_randomSelectAndRemove - randomly selects an element from the given list and removes it from the list
- mas_randomSelectAndPush - like mas_randomSelectAndRemove, but also pushes the event to the stack
- mas_insertSort - insertion sort an item into a list
- mas_splitSeenEvents - splits a list of seen events into seen and most_seen
- mas_splitRandomEvents - splits dict of events into seen and unseen
- mas_buildEventLists - builds the unseen / seen / most seen event lists
- mas_buildSeenEventLists - builds the seen / most seen event lists
initializes MASAccessory
, MASHair
, and MASClothes
objects
Creates the custom displayable updater screen
- MASUpdaterDisplayable - custom displayable that does better update checking than the stock update check screen
one function
- clearUpdateStructs - deletes update data to save space
Initializes calendar displayable
- json
- MASCalendar - displayable that allows for a selectable calendar or a viewing calendar
Calendar database and functions for it
- datetime
- json
- renpy
- calendar_database - complicated dict of dicts for storing calendar events. See the code for more info.
- genFriendlyDispDate - creates display friendly date/time from a datetime (its a bit more complicated than that though)
- save/loadCalendarDatabase - saving and loading
- addEvent* - functions for adding Events to the calendar
- addRepeatable* - functions for adding Repeatables to the calendar
- removeEvent* - functions for removing Events from the calendar
- removeRepeatable* - functions for removing Repeatables from the calendar
creates the custom graphics menu displayable
MASGraphicsMenu - custom displayable for changing the render
initializes some hangman constants
store
copy
random
-
MONI_WORDS
- list of monika's words -
EASY_MODE
- constant for easy hangman mode -
NORM_MODE
- constant for normal hangman mode -
HARD_MODE
- constant for hard hangman mode
-
hm_words
- dict of current selectable words by difficulty -
all_hm_words
- dict of all hangman words by difficulty
state vars for button enabling
- talk_enabled - True enables talk button, False disables
- music_enabled - True enables music button, False disables
- play_enabled - True enables play button, False disables
- movie_buttons_enabled - True enables play button, False disables (unused)
state vars for hotkey enabling
- talk_enabled - True enables talk hotkey, False disables
- music_enabled - True enables music hotkey, False disables
- play_enabled - True enables play hotkey, False disables
- mu_stop_enabled - True enables music volume lowering / stopping hotkeys, False disables
- no_window_hiding - True disables window hiding, False enables
sets up music functions and the music menu
- os
- mutagen.mp3
- mutagen.oggopus
- mutagen.oggvorbis
NOTE: all song names and filepaths are constants here (official songs, not custom songs)
- PAGE_LIMIT - number of songs per page
- current_track - currently playing song
- selected_track - last selected track
- menu_open - True if the music menu is open, False otherwise
- music_choices - contains the music list
- music_pages - paginated music list
- adjustVolume - adjusts volume of an audio channel
- getVolume - gets volume of an audio channel
- getPlayingMusicName - gets the name of the currently playing song
- initMusicChoices - initializes the music menu
- isInMusicList - checks if a song is int he music menu list
Sets up the file reactions framework
store
mas_utils
datetime
random
-
filereact_db
- File reactionEvent
database -
filereact_map
- mapping filenames to file reaction events. -
foundreact_map
- volitaile map containing reactable filenames to on disk filenames. -
th_foundreact_map
- threaded variant offoundreact_map
-
connectors
-MASQuipList
of connectors for file reactions -
gift_connectors
-MASQuipList
of gift connectors for file reactions
-
addReaction
- adds a file reaction (this is internalized, there is a global variant)
Declares displayable for selectables
random
-
MASSelectableImageButtonDisplayable
- displayable for an image button that is associated with selectable.
This is considered the default init level when no number is provided. Additionally this init level covers:
-
default
statements -
define
statements - screens (unless changed by init offset)
- labels (unless changed by init offset)
- styles (unless changed by init offset)
- transforms (unless changed by init offset)
inits chess constants. None are useful outside of here.
inits a ton of stuff. Not going to list them here since there's just too many
inits some config vars
all stock audio is defined here. Rain is added to this store as well.
suntime-related constants and vars are defined here
times used in idle exp calcs
constants for amount of XP gained for things
inits import Event
related functions
- evhand
- datetime
- addEvent - adds an
Event
object to anEvent
database. Core function used for every Event init. - global versions of hideEvent*/lockEvent*/unlockEvent* functions
- global versions of isFuture/isPresent/isPast functions
- pushEvent - push an Event to the Event stack
- queueEvent - queues an Event to the Event stack
- popEvent - pops the next Event from the stack.
- seen_event - checks if an Event has been seen or is currently in the Event stack
- restartEvent - pushes an interuppted Event back onto the Event stack if its not in the blacklist
- mas_isRstBlk - checks if the given label is part of the blacklist
- mas_cleanJustSeen* - functions for cleaning an Event list of things that were seen recently
- mas_unlockPrompt - attempts to unlock a Pool Event
1 function lol
- dumpPersistentToFile - does what it says
key configuration vars
key gui vars
build settings
key preferences
pong's displayable as well as other pong-stuff
- random
- math
- PongDisplayable - displayable that runs pong
key functions for xp system
- grant_xp - give some experience
- get_level - returns the user's current level
a couple of functions
- RigMouse - aka the mouse movement glitch
- FinishEnterName
- FileActionMod - shows that save dialogue thing
Inits constants for layout adjustments, and some helper functions for them too
- store
- mas_affection
NOTE: this makes a ton of constants, only going to mention important ones here
- QUIT_MAP - mapping of affection levels to what their QUIT messages should be
affection state vars, the final farewell displayable, surprise text code
-
mas_curr_affection
- current affection state -
mas_curr_affection_group
- current affection state group
- MASFinalNoteDisplayable - displayable for the final farewell poem
Very wide variety of things. Kind of like definitions 2. Also retrieves currentuser, checks playername vars, checks for battery support, registers the background audio channel. Only going to mention some of the stuff here.
- subprocess
- os
- eliza
- datetime
- battery
- re
- songs
hkb_button
mas_globals
-
morning_flag
- True if it's currently morning, False if not. this is more like a previous state var.
-
show_dialogue_box
- jumps to the talk menu -
pick_game
- jumps to Play menu -
mas_enable_quitbox
- enables monika's quit dialogue warning -
mas_disable_quitbox
- disables monika's quit dialogue warning -
mas_enable_quit
- enables quitting without monika knowing -
mas_disable_quit
- disables quitting without monika knowing -
mas_drawSpaceroomMasks
- draws the approrpriate window masks -
show_calendar
- shows the calendar. this is the callback for clicking the calendar button -
slow_dismiss
- callback for when Monika talks -
is_morning
- checks if it's currently morning -
mas_shouldRain
- checks if it should rain based on current affection -
mas_forceRain
- forces rain art, sounds, and locks rain topics -
mas_lockHair
- locks hair topics
Stuff related to the Listen option in the opendoor greeting
- eardoor - list of unseen (or all) Listen options
-
eardoor_all
- list of all the Listen options
Stuff related to the opendoor greeting
-
MAX_DOOR
- I dont remember what this is for -
chance
- 1 out of x chance this greeting will appear
We dont use this
Splash messages are defined here
All of Monika's images are defined here
Coffee-related vars are defined here
inits a ton of updater related stuff
- regular - update link
- unstable - unstable link
- timeout - timeout for update checking
- force - set to True to force an update check
- checkUpdate - checks for an update using Renpy's update checker
functions related to update script migrations
- removeTopicID - unsees a topic if it has been seen
-
mas_eraseTopic
- removes an Event from its persistent database and lock db -
mas_transferTopic
- transfers an Event's data and lock db data to another Event -
mas_transferTopicSeen
- transfers an Event's seen data to another Event - adjustTopicIDs - removes / transfers an Event's seen status
- updateTopicIDs - updates a dict of Event's seen statuses
- updateGameFrom - runs update scripts in the proper order
mapping system for update script migrations
-
version_updates
- dict that maps a version to its next update version -
topics
- dict that maps a version to the topic adjustments it requires
declares some runtime functions, adds Repeatables to the calendar.
- mas_calendar
-
mas_calDropOverlayShield
- enables input for the calendar overlay -
mas_calHideOverlay
- hides the calendar overlay -
mas_calIsVisible_ovl
- checks if the calendar overlay is visible -
mas_calRaiseOverlayShield
- disables input for the calendar overlay -
mas_calShowOverlay
- shows the calendar overlay, if not already showing
not core, but still important functions
store
cPickle
-
setMoniSize
- does some calculating to figure out the appropriate Monika filesize
basically all the hotkey-related functions are here. I'm only listing the public ones.
-
mas_HKRaiseShield
- disables the t/m/p hotkeys -
mas_HKDropShield
- enables the t/m/p hotkeys -
mas_HKIsEnabled
- checks if the t/m/p hotkeys are enabled -
mas_HKCanQuietMusic
- checks if we can lower or stop the music -
enable_esc
- enables the game menu / escape key (viaquick_menu
) -
disable_esc
- disables the game menu / escape key (viaquick_menu
) -
set_keymaps
- inits the keymaps
inits runtime hotkey button functions, as well as shows the buttons
-
HKBHideButtons
- hides the buttons -
HKBShowButtons
- shows the buttons -
mas_HKBRaiseShield
- disables the buttons -
mas_HKBDropShield
- enables the buttons -
mas_HKBIsEnabled
- checks if the buttons are enabled -
mas_HKBIsVisible
- checks if the buttons are visible -
MovieOverlayHideButtons
- hides movie buttons -
MovieOverlayShowButtons
- shows movie buttons
declars music-related functions
- songs
-
dec_musicvol
- decreases music channel volume -
inc_musicvol
- increases music channel volume -
mute_music
- mutes music channel -
play_song
- plays a song onto the music channel -
mas_startup_song
- starts playing thepersistent
.current_track -
select_music
- runs the music selection menu
defines shield functions
-
mas_DropShield_core
- enables core interactions -
mas_RaiseShield_core
- disables core interactions -
mas_DropShield_dlg
- enables dialogue-breaking interactions -
mas_RaiseShield_dlg
- disables dialogue-breaking interactions -
mas_DropShield_mumu
- enables music-menu-breaking interactions -
mas_RaiseShield_mumu
- disables music-menu-breaking interactions -
mas_MUMUDropShield
- enables the music menu -
mas_MUMURaiseShield
- disables the music menu
Public versions of some key reaction functions
-
addReaction
- adds file reactions -
mas_checkReactions
- checks file reactions
huge number of chess constants, chess dialogue vars, as well as chess checking functions. Also initializes the dialogue actions map and the chess quiplists
os
chess.png
-
quit_game
- enables quitting a chess match
-
isInProgressGame
- checks if a pgn game is valid and in progress
Properly sets persistent.steam
Sets up the random chatter functions and constants
-
adjustRandFreq
- adjusts random chatter frequency given a slider value -
getRandChatDisp
- converts random chatter frequency into a display string
Core action functions for Event
's usage. All of this stuff should be internal only.
Creates coffee related functions
-
mas_isCoffeeTime
- checks if its coffee time -
mas_brewCoffee
- starts brewing coffee -
mas_drinkCoffee
- starts drinking coffee -
mas_resetCoffee
- resets coffee vars
Creates the final farewell poem
makes the mas_randchat
store globally available
adjust islands flag if needed
declares helper functions for python tips
datetime
evhand
-
has_day_past_tip
- checks if a tip has been seen and a day has past -
has_day_past_tips
- multiple arg version of above function
Runs pre-script topics update code. Not really used
Every topic is created at this init level. Avoid using this init level for anything else. We also use this init to generate the backup notes.
Runs the label that inits the updates
store with update mapping data.
Sets up anniversary database as well as key anniversary adjusting functions
-
ANNI_LIST
- list of anniversaries in order of potential appearance
-
anni_db
-Event
database for anniversaries
-
_month_adjuster
- adjusts months for a new start date -
_day_adjuster
- adjust days for a new start date -
add_cal_annis
- adds anniversaries to the calendar -
clean_cal_annis
- cleans anniversaries from the calendar -
reset_annis
- resets all anniversaries using a new start date -
unlock_past_annis
- unlocks all anniversaries that are past the current date
This is just for the Listen option for the greetings. It removes seen labels and does resets if necessary.
Declares the background update check function
-
mas_backgroundUpdateCheck
- launches the background update check thread
Runs the version update migration scripts.
Inits the wordlists for hangman
sets music_volume
to the current volume of the music channel
Properly sets the custom music directory, current track and the available music choices.
Builds the event lists and sets seen limit to huge amount if necessary.
-
mas_rev_unseen
- list of unseenEvent
s -
mas_rev_seen
- list of seenEvent
s -
mas_rev_mostseen
- list of most seenEvent
s
Contains all the affection programming points, the logic to run those programming points, and wrapper functions around the core affection state comparators.
Also initializes the variying talk / play menu quips
NOTE: Makes a reference copy of the persistent
NOTE: Makes a reference copy of the layout
store.
store
evhand
mas_layout
NOTE: Most of these are programming points. No need to list them here
-
runAffPPs
- runs the affection state programming points -
runAffGPPs
- runs the affection state group programming points
Declares all the globally available affection functions
datetime
mas_affection
mas_utils
-
mas_apology_reason
- the reason to apologize
-
mas_FreezeGoodAffExp
- freezes affection gains -
mas_FreezeBadAffExp
- freezes affection losses -
mas_FreezeBothAffExp
- freezes affection gains and losses -
mas_UnfreezeGoodAffExp
- unfreezes affection gains -
mas_UnfreezeBadAffExp
- unfreezes affection losses -
mas_UnfreezeBothAffExp
- unfreezes affection gains and losses -
mas_compareAff
- compare-to function for comparing affection states -
mas_compareAffG
- compare-to function for comparing affection group states -
mas_isMoniBroken
- checks if current affection is broken (or lower/higher) -
mas_isMoniDis
- checks if current affection is distressed (or lower/higher) -
mas_isMoniUpset
- checks if current affection is upset (or lower/higher) -
mas_isMoniNormal
- checks if current affection is normal (or lower/higher) -
mas_isMoniHappy
- checks if current affection is happy (or lower/higher) -
mas_isMoniAff
- checks if current affection is affectionate (or lower/higher) -
mas_isMoniEnamored
- checks if current affection is enamored (or lower/higher) -
mas_isMoniLove
- checks if current affection is love (or lower/higher) -
mas_isMoniGSad
- checks if current affection group is sad (or lower/higher) -
mas_isMoniGNormal
- checks if current affection group is normal (or lower/higher) -
mas_isMoniGHappy
- checks if current affection group is happy (or lower/higher) -
mas_updateAffectionExp
- sets the affection states to the correct value and runs affection programming points when appropriate -
mas_gainAffection
- increases affection -
mas_loseAffection
- decreases affection -
mas_setAffection
- sets affection to a value -
mas_checkAffection
- pushes an appropriate event based on affection level
sets up the appropriate layout vars for ui text
declars a function for adjusting the conditional of the start date Event
-
mas_chgCalEVul
- literally just changes conditional for the state dateEvent
sets up holiday related start up stuff
Declares Monika's dockingstation function
store
cStringIO
os
mas_greetings
mas_ics
mas_sprites
evhand
random
datetime
threading
-
generateMonika
- generates monika's new character file -
findMonika
- finds Monika's character file -
init_findMonka
- find Monika, init version -
parseMoniData
- parses monika character file data into components -
selectReturnHomeGreeting
- picks an appropriate greeting if we are returning monika to characters folder -
diffCheckTimes
- returns a timedelta difference between last checkin/checkout times -
packageCheck
- more generic package checking function that can do eithersignForPackage
andcreatePackageSlip
-
checkinMonika
- checks Monika into the docking station -
checkoutMonika
- checks Monika out of the docking station -
getCheckTimes
- gets a corresponding checkin/checkout time for a given checksum
Loads selectable data.
Declares async promises.
mas_threading
-
monikagen_promise
-MASAsyncWrapper
object for generation Monika -
monikafind_promise
-MASAsyncWrapper
object for finding Monika
-
abortGenPromise
- specifically aborts the generation promise in case we aborted it.
All images are built at this init level.
Declares overlay-related functions
-
mas_OVLDropShield
- enables all overlay screens -
mas_OVLHide
- hides all overlay screens -
mas_OVLRaiseShield
- disables all overlay screens -
mas_OVLShow
- shows all overlay screens
Holds the functions for adding JSON songs to piano
json
-
addSong
- adds a song to thePianoNoteMatchList
database -
addCustomSongs
- parses the custom song folder for songs and adds them to thePianoNoteMatchList
database -
addStockSongs
- adds a preset list of songs to thePianoNoteMatchList
database
Adds the stock and custom songs to the PianoNoteMatchList
database. Also declares a function for generating the piano song menu.
-
getSongChoices
- generates a list of tuples for the piano song selection menu
Deletes files of reactions that failed to be deleted.
Creates the piano displayable
mas_piano_keys
-
PianoDisplayable
- displayable that runs the piano
-
pnmlLoadTuples
- loadsPianoNoteMatchList
data frompersistent
into corresponding objects in thePianoNoteMatchList
database -
pnmlSaveTuples
- savesPianoNoteMatchList
data intopersistent
from corresponding objects in thePianoNoteMatchList
database
Creates the centralized Event
database for easy lookup
-
mas_all_ev_db
-Event
database that contains allEvent
s
-
mas_getEV
- gets anEvent
object from the centralized database -
mas_getEVCL
- gets a calendar label for anEvent
object
inits the chess quiplist
In general, all DelayedAction constructor functions are built here.
Inits the quit messages for layout
Checks for:
- monika's file
- file reactions
- bday stuff
- o31 stuff
mas_filereacts
Sets up the DelayedAction map
-
MAP
- Maps DelayedAction IDs to constructor functions
-
loadDelayedActionMap
- generates the runtime map of DelayedActions frompersistent
-
saveDelayedActionMap
- saves the runtime map of DelayedActions topersistent
Runs DelayedActions at the init stage
Runs the late update scripts