Init Pipeline - Monika-After-Story/MonikaModDev GitHub Wiki
UPDATE:
I will not be updating this anymore. There are too many changes to track. I will instead write a script to retrieve functions based on init level, but thats about it.
This page will be explanation of all the init levels we use in MAS, which should act as a helpful timeline of startup events.
NOTE: While we previously listed functions/vars/constants/imports, we will no longer list those. Every init
event will continue to be listed, but only summary information will be given instead of specifics. (If applicable)
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. Data verification functions can be used after -990.
persistent
s are backed up at -900.persistent
s are also cleaned of useless data.- Time travel is detected at -890.
- Data migration can happen at -897.
- Data verification occurs at -895.
- Bad update files from a failed update are cleaned at -894.
- 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.
- Databases are mapped to codes and yearsets are cleaned at 4.
- All topics are created at 5.
- EV functions can be used after 6.
- Update migration mapping is setup at 9.
- Update scripts run at 10.
- Affection functions can be used after 20.
- JSON-based sprites are loaded at 190.
- 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.
QUICKLINKS
levels
- early
- -999
- -990
- -985
- -950
- -900
- -897
- -895
- -894
- -890
- -880
- -875
- -876
- -860
- -850
- -816
- -815
- -810
- -800
- -750
- -600
- -500
- -150
- -101
- -100
- -45
- -21
- -20
- -11
- -10
- -9
- -5
- -4
- -3
- -2
- -1
- 0
- 1
- 2
- 4
- 5
- 9
- 10
- 11
- 15
- 20
- 21
- 100
- 189
- 190
- 200
- 205
- 500
- 501
- 790
- 800
- 810
- 899
- 900
- 970
- 994
- 995
- 999
Now for the actual init levels.
early
global (definitions)
The Event
, MASButtonDisplayable
, MASQuipList
and MASMailbox
classes are defined here.
Also basically the Event framework.
imports
singleton
datetime
constants
MAS_MONIKA_Z
- zorder for monika displayMAS_BACKGROUND_Z
- zorder for bg displayEV_ACT*
- EV action constants + list of those constants
classes
Event
- core class that represents basically every topicMASButtonDisplayable
- core displayable that can act as a button in custom displayablesMASQuipList
- quip manager class for easy quip management. Not used often, but can do random label launching nicelyMASMailbox
- async communication helper for comms between objects. Users should extend this rather than use directly.MASLinearForm
- class to represent linear functions. used in clickzonesMASEdge
- class to represent an line with 2 points (edge). used in clickzonesMASClickZone
- polygon zone that react if clicked in. Capable of using an arbitrary list of verticies.MASInteractable
- base class for all interactble displayables that use clickzones
mas_ev_data_ver
(event-handler)
Declares all verification functions
imports
__builtin__
datetime
global (event-handler)
Flowcheck (FC) constants are defined here
constants
MAS_FC_*
- flowcheck constants and list of them for DelayedAction framework
global (zz_backup)
Does persistent checks and disables backup system if necessary.
-999
global (definitions)
sets not_finite_loop
checking to 120 seconds instead of 60.
Also creates the log folder if it doesn't exist.
imports
os
_mas_dm_dm
(zz_dm
)
Contains all functions as well as the current data version for data migrations. All data migration functions should be here.
imports
store
-990
mas_utils
(definitions)
Core utility functions are defined here
imports
store
os
stat
shutil
datetime
codecs
platform
time
expanduser
fromos.path
LogFile
fromrenpy.log
functions
clean_gui_text
- cleans gui text by removing key symbolscopyfile
- copies files from one location to anothergetMASLog
- gets the appropriate log file to use for logginglogrotate
- does a log rotation for a given logpdget
- Protected Dict GET. gets an item from a dict with protections for Nones and suchtrydel
- attempts to delete a file at a pathtryparsedt
- attempts to parse a string into a datetimetryparseint
- attempts to parse a value into an inttrywrite
- attempts to write a filewritelog
- writes messages to mas log
-985
global (definitions)
Various important global functions
functions
mas_getAbsenceLength
- gets time difference between current session start and the last session end. always returns adatetime.timedelta
mas_getCurrSeshStart
- gets the current session start. always returns adatetime.datetime
mas_getFirstSesh
- gets the first session datetime. always returns adatetime.datetime
mas_getLastSeshEnd
- gest the last session end. always returns adatetime.datetime
mas_getSessionLength
- gets length of the current session. always returns adatetime.timedelta
mas_isFirstSeshPast
- checks if first session is past a given datemas_TTDetected
- checks if time travel was detected
-950
mas_ev_data_ver
(event-handler)
Declares curried verify objects
imports
store
-900
mas_affection
(script-affection)
Affection constants and core functions
constants
BROKEN
- broken aff stateDISTRESSED
- distressed aff stateUPSET
- upset aff stateNORMAL
- normal aff stateHAPPY
- happy aff stateAFFECTIONATE
- aff aff stateENAMORED
- enamored aff stateLOVE
- love aff state_aff_order
- affection states in the "natural order" of affection, from lowest to highest_aff_level_map
- map of affection states, used in validations._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
global (script-holidays)
Deletes christmas.rpy and rpyc.
global (zz_backup)
Runs the persistent
backup system. All code here is not intended for runtime usage.
imports
- os
- mas_utils
mas_ics
(zz_dockingstation
)
Initializes image checksums and file maps for decoding images at runtime
imports
os
-897
zz_dm
)
global (Data migration that happens after backup. Data versions should be set
-895
mas_ev_data_ver
(event-handler)
Verifies persistent event data
-894
global
(updater
)
cleans bad update files
-890
mas_globals
(script-ch30
)
time travel is detected
imports
datetime
store
vars
tt_detected
- True if time travel was detected. This is limited to checking if we went back in time.
-880
global
(event-handler
)
Sets up the MASDelayedAction
framework core.
vars
persistent._mas_delayed_action_list
- static list ofMASDelayedAction
ids. initialized if Nonemas_delayed_action_map
- runtime map ofMASDelayedActions
classes
MASDelayedAction
- class used for the DelayedAction framework
functions
mas_removeDelayedAction
- functions used for removing/dequeing DelayedActionsmas_runDelayedAction
- attempts to run DelayedActionsmas_addDelayedAction
- functions used for adding/queueing DelayedActions
mas_delact
(event-handler
)
Declares a special function for adding MASDelayedAction
ids early in the pipeline.
imports
store
functions
_MDA_safeadd
- special function for early adding ofMASDelayedAction
. Normal users should use the approved add/remove functions instead of this._MDA_saferm
- special function for early removing ofMASDelayedAction
. Normal users should use the approved add/remove functions instead of this.
-876
In general, all MASDelayedAction
constructor functions are built here.
mas_delact
(script-greetings
)
Contains MASDelayedAction
constructor functions for greetings
mas_delact
(script-holidays)
Contains MASDelayedAction
constructor functions for holiday events
mas_delact
(script-islands-event
)
Contains MASDelayedAction
constructor functions for the islands event
mas_delact
(script-story-events
)
Contains MASDelayedAction
constructor functions for the bday events. Also contains the action callables for those MASDelayedActions
.
-875
mas_delact
(event-handler
)
Contains a map mapping MASDelayedAction
creation functions to IDs.
Because of this, all MASDelayedAction
creation functions need to be created before this init level.
imports
datetime
-860
mas_history
(zz_history
)
Declares main history saver functions and constants, as well as some persistents
imports
store
datetime
constants
L_FOUND
- found data in the archivesL_NO_YEAR
- did not find year in the archivesL_NO_KEY
- did not find key in the archives
functions
addMHS
- adds aMASHistorySaver
object to the database.getMHS
- retrieves aMASHistorySaver
object based on ID
-850
global
(zz_history
)
Declares public history saver functions and the main class
classes
MASHistorySaver
- history saving object that automates data migration as well as other things
functions
mas_HistLookup
- looks up data in the archivesmas_HistLookup_k
- key-centric version ofmas_HistLookup
mas_HistLookup_ot
- looks up data in the archives, over multiple yearsmas_HistLookup_otl
- looks up data in the archives, given a list of yearsmas_HistLookup_otl_k
- key-centric version ofmas_HistLookup_otl
mas_HistVerify
- checks if some data matches what was stored in the archives at one point. (checks multiple years)mas_HistVerify_k
- key-centric version ofmas_HistVerify
-816
MASDelayedAction
callbacks can be defined here, but it's better to define them closer to where they are needed.
-815
mas_history
(script-holidays)
Where programming points for MASHistorySaver
objects for holidays are defined.
mas_history
(zz_history
)
Where programming points for MASHistorySaver
objects can be defined.
imports
_MDA_safeadd, _MDA_saferm
frommas_delact
-810
Most MASHistorySaver
objects are created here.
global
(script-holidays
)
Creates the MASHistorySaver
object for o31, d25, nye, player bday, f14
global
(zz_history
)
Creates the MASHistorySaver
object for player model variables and bday.
-800
mas_history
(zz_history
)
Runs the MASHistorySaver
algorithm.
-750
mas_threading
(zz_threading
)
Declares the MASAsyncWrapper
class
imports
threading
classes
MASAsyncWrapper
- class that does nicely abstracted multithreading / async functions
-600
mas_delact (event-handler)
imports
- store
-500
global (event-handler)
Initializes the LOCK DB portion of the Event
framework.
vars
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 Nonepersistent._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
mas_dockstat
(zz_dockingstation
)
initializes key dockstat constants
constants
blocksize
- irl blocksize we should be using for any file I/Ob64_blocksize
- irl blocksize we should be using for file I/O with base64 encoded filesMAS_PKG_*
- monika status constantsMAS_SBD_*
- monika surprise party constants
-150
mas_selspr
(zz_selector
)
Selector rules should be defined here
-101
mas_sprites
(sprite-chart
)
ACSTemplate
s are defined here
-100
mas_utils
(definitions)
Initializes utility functions, mainly ones not needed super early
imports
datetime
ctypes
random
cStringIO.StringIO
functions
add_years
- date adjusting functionadd_months
- date adjusting functionam3
- takes a datetime object and returns it with time set to 3amlog_entry
- logs historical entries into the given logmdnt
- takes a datetime object and returns it with time set to midnightnormalize_points
- normalizes a list of points with offsetssod
- takes a datetime object and returns it with time set to the "start of day"randomblob
- generates a random blob of data in a StringIO buffertryparsefloat
- attempts parsing a value into a float
global (splash)
checks if the DDLC archives are in the game folder.
mas_selspr
(zz_selector
)
sets up prompt map
imports
store
mas_utils
functions
get_prompt
- gets prompt for a selector topic via keyin_prompt_map
- checks if a prompt selector exists for a keyset_propmt
- sets prompt for a selector topic via key
-45
global (zz_dockingstation)
Initializes the DockingStation framework.
imports
os
vars
mas_docking_station
- instance ofMASDockingStation
, centered around the characters folder
classes
MASDockingStation
- class designed for easy base64 file i/o + checksums. (think giving files and taking monika out)
-21
mas_sprites_json
(zz_sprites_json
)
Defines key constants and maps for JSON-based sprites
-20
mas_background
(zz_backgrounds
)
declares key MASBackground
loading/saving functions.
NOTE: MASBackground
is foolishly declared later in the pipline so do not call anything in here until after -10
.
global
(zz_selector
)
Declares selectable classes.
classes
MASSelectableAccessory
- Selectable class for accessoriesMASSelectableHair
- Selectable class for hairMASSelectableClothes
- Selectable class for clothes
mas_weather
(zz_weather
)
Important weather data + weather programming points
imports
random
datetime
store
constants
WEATHER_MAP
- database of weather objects
functions
loadMWData
- loads weather data from persistentsaveMWData
- saves weather data to persistentntunlockedWeathers
- returns number of unlocked weather itemsweatherProgress
- changes weather for progressive weather if appropriate
-11
mas_o31_event
(script-holidays
)
Sets up the o31 event vars and image decoder
imports
store
mas_dockstat
mas_ics
vars
o31_cg_station
- MASDockingStation instance centered around the o31 cg foldero31_cg_decoded
- True if we decoded the cg, False otherwisemas_return_from_tt
- True if we just returned from the Trick/Treat farewell
functions
decodeImage
- decodes a specific cg imageremoveImages
- removes all cg imagesisMonikaInCostume
- True if monika is in costume, False otherwiseisTTGreeting
- True if we have a greeting type associated with a Trick/Treat farewellspentO31
- True if user spent o31 with the player, False if not
global (script-holidays)
1 function
functions
mas_player_bday_curr
- sets date of current year bday, accounting for leap year
mas_player_bday_event
(script-holidays)
Image functions
functions
show_player_bday_Visuals
- shows player bday visualshide_player_bday_Visuals
- hides player bday visuals
mas_island_event
(script-islands-event
)
Sets up the island event image decoder function
imports
store
mas_dockstat
mas_ics
vars
islands_station
- MASDockingStation instance centered around the islands folder
functions
decodeImages
- decodes island imagesremoveImages
- removes island images
mas_dockstat
(zz_dockingstation
)
sets up image decoder functions
imports
mas_utils
functions
decodeImages
- generic image decoderremoveImages
- generic image remover
mas_filereacts
(zz_reactions
)
Sets up the file reactions framework
imports
store
mas_utils
datetime
random
vars
filereact_db
- File reactionEvent
databasefilereact_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 reactionsgift_connectors
-MASQuipList
of gift connectors for file reactions
functions
addReaction
- adds a file reaction (this is internalized, there is a global variant)
-10
All Date-related functions should be init'd here. Please move them here if not already done so.
global (script-affection)
Declares affection loading/saving functions.
mas_apology
(script-apologies)
Apology database is initialized here
global (script-ch30)
Initializtion of mas_idle_mailbox
(the idle mailbox)
vars
mas_idle_mailbox
- the idle mailbox
mas_fun_facts
(script-fun-facts
)
fun-fact database and types
global (script-holidays)
Date checking functions for holidays
functions
mas_isO31
- determines if the given date is o31mas_isD25
- determines if given date is d25mas_isD25Eve
- determines if given date is d25 evemas_isD25Season
- determines if given date is in d25 seasonmas_isD25Post
- determines if given date is in d25 season but after d25mas_isD25PreNYE
- determines if given date is in d25 season but before nyemas_isD25PostNYD
- determines if given date is in d25 season but after nydmas_isD25Gift
- determines if given date is in range of days where gifts can be considered d25 giftsmas_isD25Outfit
- determines if given date is in range of days where Monika wears the santa outfitmas_isNYE
- determines if given date is nyemas_isNYD
- determines if given date is nydmas_isplayer_bday
- determines if given date is player birthdaymas_isF14
- determines if given date is f14
global (script-islands-event)
Decodes images.
vars
- mas_cannot_decode_images - True if we failed to decode the images, False otherwise
mas_songs
(script-songs
)
song database defined hre
global (updates)
sets up some flags used by the updater. these things are mostly legacy for updating from super old versions.
vars
- 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.
zz_backgrounds
)
global (Defines the MASBackground
class
mas_calendar (zz_calendar)
calendar constants
constants
- CAL_TYPE_* - calendar Event types
mas_hotkeys (zz_hotkeys)
state vars for enabling certain functions
vars
- allow_dismiss - True enables dismissing, False disables
functions
- allowdismiss - returns state of allow_dismiss
mas_interactions
(zz_interactions
)
Key functions and constants for interactables
mas_selspr
(zz_selector
)
Declares selection screen constants and functions, and the selectable mailbox class. Also generic selector dialgoue
global (zz_transforms)
only one thing. the image existence checker
functions
- getCharacterImage - retrieves the Displayable of a character + expression
mas_windowreacts
(zz_windowreacts
)
initial vars and database
vars
can_show_notifs
- True if we can show notifs, False if we cannot
-9
zz_interactions
)
global (MASBoopInteractable
defined here, but unused.
-5
mas_sprites
(sprite-chart
)
Declares all the functions and constants used for DynamicDisplayable creation
constants
NOTE: There are lots of constants here. Only including the ones that might need to be changed often.
POSES
- list of non-leaning posesL_POSES
- list of leaning posesSP_ACS
- sprite code for ACS (pulled from sprite jsons)SP_HAIR
- sprite code for HAIR (pulled from sprite jsons)SP_CLOTHES
- sprite code for CLOTHES (pulled from sprite jsons)EXPROP_TOPIC_MAP
- maps an exprop to list of related topicsACSTYPE_TOPIC_MAP
- maps asc type to its selector topic
vars
lean_acs_blacklist
- list of accessories that should disable leaning
functions
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 accessoriesinit_hair
- initalizes a hairstyle for later use. required for all hairstylesinit_clothes_
- initializes clothes for later use. required for all clothestryparsehair
- checks if the given hair string existstryparseclothes
- checks if the given clothes string existsrm_acs
- removes an acs from the maplock_exprop_topics
- locks topics related to an exproplock_acstype_topics
- locks topics related to an acs typeunlock_exprop_topics
- unlocks topics related to an expropunlock_acstype_topics
- unlocks topics related to an acs typeget_sprite
- returns sprite object given sprite name and sprite type
-4
global (zz_poemgame)
initializes some poemgame classes and functions
classes
- MASPoemWord - version of PoemWord that includes Monika
- MASPoemWordList - encapsulates MASPoemWords into a list
functions
- glitchWord - glitches the given text with odds for space / unicode. better to use giltchtext for fully glitched text.
-3
mas_piano_keys (zz_pianokeys)
initializes lots of backing framework for the piano game + menus
imports
- pygame
- os
constants
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
vars
- 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.
classes
- PianoNoteMatch - represents a note phrase + lyrics in piano
- PianoNoteMatchList - represents a list of PianoNoteMatches (aka a song) in piano
functions
NOTE: contains a huge amount of functions needed for JSON converting. None are useful outside of piano.
-2
mas_anni
(script-anniversary
)
Declares helper anniversary build functions
NOTE: contains a pointer copy to persistent
imports
evhand
mas_calendar
mas_utils
datetime
functions
build_anni
- builds an anniversary date using thefirst_session
datetime and the given advancersbuild_anni_end
- same asbuild_anni
, except gets the ending datetime of an anniversaryisAnni
- checks if the today is an anniversary, using the given milestoneisAnniWeek
- checks if today is a 1 week anniversaryisAnniOneMonth
- checks if today is a 1 month anniisAnniThreeMonth
- checks if today is a 3 month anniisAnniSixMonth
- checks if today is a 6 month anniisAnniAny
- checks if today is any annianniCount
- returns how many years the player has been with monikapastOneWeek
- True if player has been with monika for at least 1 weekpastOneMonth
- True if player has been with monika for at least 1 monthpastThreeMonths
- True if player has been with monika for at least 3 monthspastSixMonths
- True if player has been with monika for at least six months
mas_topics (script-topics)
Initializes topic-related constants and helper functions
constants
- 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
global (sprite-chart)
Initializes MASMonika character object for hair/clothing/acs framework
imports
math
namedtuple
(UNUSED)
classes
MASMonika
- represents Monika's clothes and hair and accessoriesMASPoseMap
- helper class for mapping poses to images.MASSpriteBase
- base class for all object-represented sprite setsMASSpriteFallbackBase
- base class for all object-represented sprite sets that can useMASPoseMap
as a fallback systemMASAccessory
- class representation of an accessoryMASHair
- class representation of a hairstyleMASClothes
- class representation of clothes
functions
mas_drawmonika
- drawing function used for DynamicDisplayables
mas_sprites
(sprite-chart)
Programming points for sprites
imports
store
mas_background
(zz_backgrounds
)
prog points for MASBackground
s should be defined here
mas_poemgame_fun (zz_poemgame)
Poemgame-related functions initalized here Everything here is suitable only for the poemgame, so not going to mention them here.
mas_sprites
(zz_spriteobjects
)
general-use progpoints
-1
_mas_root
(definitions)
contains very powerful functions. not for the faint of heart
imports
store
datetime
functions
glitchtext
- copy of the existing glitchtext function. This was before I knew aboutstore
mangleFile
- mangles a file by messing with its bytesresetPlayerData
- resetspersistent
data. pretty dangerousinitialSessionData
- resets session data to default
global (definitions)
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).
imports
datetime
os
functions
get_procs
- retreives list of running processes if on windowsis_running
- checks if a process in the given list of process names is currently runningis_file_present
- checks if a file is presentmas_cvToDHM
- converts miniutes into a displayable form of hour / minutesmas_cvToHM
- converts minutes into hour / minutesmas_genDateRange
- generates a list of dates within a given range (exclusive)mas_isSTtoAny
- checks if a time object is within a suntime amount and an hour / minute amountmas_isSRtoAny
- checks if a time object is within sunrise and an hour / minute amountmas_isSStoAny
- checks if a time object is within sunset and an hour / minute amountmas_isAnytoST
- checks if a time object is within an hour / minute amount and a suntime amountmas_isAnytoSR
- checks if a time object is within an hour / minute amount and sunrisemas_isAnytoSS
- checks if a time object is within an hour / minute amount and sunsetmas_isMNtoSR
- checks if a time object is wtihin midnight to sunrisemas_isSRtoN
- checks if a time object is within sunrise to noonmas_isNtoSS
- checks if a time object is within noon to sunsetmas_isSStoMN
- checks if a time object is within sunset to midnightmas_isSunny
- checks if a time object is within sunrise to sunsetmas_isNight
- checks if a time object is not within sunrise to sunsetget_pos
- gets position of currently playing musicdelete_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 usageenumerate_steam
- returns installed Steam IDs from a steam install. Untested, unused, probably buggy
event-handler
)
evhand (Event menu constants and key functions. also contains some Event
databases
imports
store
namedtuple
datetime
constants
LAST_SEEN_DELTA
- time delta used for determining if a topic has been seen recentlyRESTART_BLKLST
- list of topics that should NOT be pushed to the event stack on a restart if they were interrupted.IDLE_WHITELIST
- list of labels that are allowed in idle
vars
event_database
-Event
database of main topics (random + pool)farewell_database
-Event
database of farewellsgreeting_database
-Event
database of greetings
functions
addIfNew
- adds items to a list of they are not in there alreadyaddYearsetBlacklist
- adds an event label to the yearset blacklistisYearsetBlacklisted
- checks if an event label is yearset blacklistedtuplizeEventLabelList
- takes a list of keys and anEvent
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*
(EasyEvent
hiding / locking / unlocking functions)
global (event-rules)
Initialzes static classes used for creating rule tuples for Event
s
imports
datetime
mas_utils
constants
EV_RULE_...
- rule type identifiers for the rule dicts in Event objectsEV_NUM_...
- numerical repeat rule constants + list of them
classes
MASNumericalRepeatRule
- creates / modifies / checks numerical repeat rules. aka repeat every x days/weeks/months/yearMASSelectiveRepeatRule
- creates / modifies / checks selective repeat rules. aka repeat when today matches this date/time criteriaMASGreetingRule
- creates / modifies / checks greeting rules. These are for deciding random chance of a greeting and/or should skip visualsMASFarewellRule
- creates / modifies / checks farewell rules. These are for deciding random chance of a farewellMASAffectionRule
- creates / modifies/ checks affection rules. These are used to determine if farewells should be shown NOT UNLOCKEDMASPriorityRule
- gives Events priority values. Usage may vary.MASUndoActionRule
- allows events to undo changes to theiraction
property when outside a date rangeMASStripDatesRule
- clearsstart_date
andend_date
from events when outside a date range
mas_pong (pong)
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.
global (screens)
layout vars for the confirm quit popup, screens, and screen styles NOTE: screens and styles here are done via init_offset rules
vars
- 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
styles
NOTE: a large amount of styles. Not going to put them here.
screens
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
classes
- PauseDisplayable - custom Displayable that acts as a much better pause
mas_affection (script-affection)
Audit log for the affection system.
imports
- os
- datetime
- mas_utils
- store
functions
audit
- function for affection change auditing
mas_globals
(script-ch30
)
Meant to initalize globals. not really used though.
vars
dlg_workflow
- True if we are in the middle of dialogue, False otherwiseshow_vignette
- True if we should show the vignette mask everywhere, False means do not showshow_lightning
- True if we should show lightning during idle, False means do not showlightning_chance
- 1 out of x chance that lightning will show during idlelightning_s_chance
- 1 out of x chance that the sayori lightning egg will show during idleshow_s_light
- True if we show the sayori thunder egg, False if nottext_speed_enabled
- True if text speed is enabled, False if notin_idle_mode
- True if in idle mode, False if notlate_farewell
- True if a late farewell just happenedlast_minute_dt
- last minute calendar-related events were checkedlast_hour
- number of the hour we last ranch30_hour
last_day
- number of the day we last ranch30_day
returned_home_this_sesh
- True if this session started with a return home
mas_compliments (script-compliments)
initializes compliment menu constants, the compliment database, and compliment quips
vars
- compliment_database -
Event
database of compliments - thanking_quips - single line quips used to thank player for compliments
mas_farewells (script-farewells)
Sets up the farewell selection function
functions
- selectFarewell - selects the farewell to use. This does a bunch of algorithm stuff.
mas_greetings
(script-greetings)
Sets up greeting types and the greeting selection function
imports
store.mas_ev_data_ver
asmas_edv
store
datetime
random
constants
TYPE_...
- greeting type constants
functions
selectGreeting
- selects a greeting to use. This does a bunch of algorithm stuff
global (script-introduction)
Not sure why this is here.
imports
- mas_affection
script-holidays
)
global (holiday functions
mas_moods (script-moods)
mood constants / database / functions
constants
- TYPE_* - mood types
vars
- mood_db -
Event
database for moods
functions
- getMoodType - gets the mood type for a given mood label
mas_ptod (script-python)
Creates the console for python teaching
imports
- mas_utils
constants
NOTE: all constants in here are purely for the console. No usage outside of this store.
functions
- 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
mas_stories
(script-stories)
story constants and database
imports
store
vars
story_database
-Event
database of stories
global
(script-topics
)
functions core to the topic selection algorithm. Also seeds random.
imports
random
songs
evhand
functions
remove_seen_labels
- removes labels that have already been seen from the given listmas_randomSelectAndRemove
- randomly selects an element from the given list and removes it from the listmas_randomSelectAndPush
- likemas_randomSelectAndRemove
, but also pushes the event to the stackmas_insertSort
- insertion sort an item into a listmas_splitSeenEvents
- splits a list of seen events into seen and most seenmas_splitRandomEvents
- splits dict of events into seen and unseenmas_buildEventLists
- builds the unseen / seen / most seen event listsmas_buildSeenEventLists
- builds the seen / most seen event listsmas_rebuildEventLists
- rebuilds the unseen / seen / most seen event lists
global (updater)
Creates the custom displayable updater screen
classes
- MASUpdaterDisplayable - custom displayable that does better update checking than the stock update check screen
global (updates_topics)
one function
functions
- clearUpdateStructs - deletes update data to save space
zz_backgrounds
)
global (the default spaceroom is defined as a MASBackground
here.
global (zz_calendar)
Initializes calendar displayable
imports
- json
classes
- MASCalendar - displayable that allows for a selectable calendar or a viewing calendar
mas_calendar (zz_calendar)
Calendar database and functions for it
imports
- datetime
- json
- renpy
vars
- calendar_database - complicated dict of dicts for storing calendar events. See the code for more info.
functions
- 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
global (zz_graphicsmenu)
creates the custom graphics menu displayable
classes
MASGraphicsMenu - custom displayable for changing the render
mas_hangman
(zz_hangman
)
initializes some hangman constants
imports
store
copy
random
constants
MONI_WORDS
- list of monika's wordsEASY_MODE
- constant for easy hangman modeNORM_MODE
- constant for normal hangman modeHARD_MODE
- constant for hard hangman mode
vars
hm_words
- dict of current selectable words by difficultyall_hm_words
- dict of all hangman words by difficulty
hkb_button (zz_hotkey_buttons)
state vars for button enabling
vars
- 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)
mas_hotkeys
(zz_hotkeys
)
state vars for hotkey enabling
vars
talk_enabled
- True enables talk hotkey, False disablesmusic_enabled
- True enables music hotkey, False disablesplay_enabled
- True enables play hotkey, False disablesderandom_enabled
- True enables derandoming, False disablesbookmark_enabled
- True enables bookmarking, False disablesmu_stop_enabled
- True enables music volume lowering / stopping hotkeys, False disablesno_window_hiding
- True disables window hiding, False enables
songs (zz_music_selector)
sets up music functions and the music menu
imports
- os
- mutagen.mp3
- mutagen.oggopus
- mutagen.oggvorbis
constants
NOTE: all song names and filepaths are constants here (official songs, not custom songs)
- PAGE_LIMIT - number of songs per page
vars
- 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
functions
- 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
global
(zz_selector
)
Declares displayable for selectables
imports
random
classes
MASSelectableImageButtonDisplayable
- displayable for an image button that is associated with selectable.
functions
mas_filterUnlockGroup
- unlocks a selector for a group if it passes certain criteria
zz_sprite_objects
)
global (initializes MASAccessory
, MASHair
, and MASClothes
objects
zz_weather
)
global (Weather objects are declared here. We also load weather data.
0
This is considered the default init level when no number is provided. Additionally this init level covers:
default
statementsdefine
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)
mas_chess (chess)
inits chess constants. None are useful outside of here.
global (definitions)
inits a ton of stuff. Not going to list them here since there's just too many
functions (key ones)
NOTE: we should move these out of here. init 0 should be avoided for all functions.
mas_passedILY
mas_ILY
- sets ILY varsmas_shouldKiss
config (definitions)
inits some config vars
audio (definitions)
all stock audio is defined here. Rain is added to this store as well.
mas_suntime (definitions)
suntime-related constants and vars are defined here
times (definitions)
times used in idle exp calcs
xp (definitions)
constants for amount of XP gained for things
global (event-handler)
inits import Event
related functions
imports
- evhand
- datetime
functions
addEvent
- adds anEvent
object to anEvent
database. Core function used for everyEvent
init.mas_hideEvent
- locks/derandoms/depools/deconditionals an eventmas_hideEventLabel
- same as above but for an event labelmas_showEvent
- unlocks/randoms/pools an eventmas_showEventLabel
- same as above but for an event labelmas_lockEvent
- locks an eventmas_lockEventLabel
- same as above but for an event labelmas_unlockEvent
- unlocks an eventmas_unlockEventLabel
- same as bove but for an event label- global versions of isFuture/isPresent/isPast functions
pushEvent
- push an Event to the Event stackqueueEvent
- queues an Event to the Event stackpopEvent
- pops the next Event from the stack.seen_event
- checks if an Event has been seen or is currently in the Event stackrestartEvent
- pushes an interuppted Event back onto the Event stack if its not in the blacklistmas_isRstBlk
- checks if the given label is part of the blacklistmas_cleanJustSeen*
- functions for cleaning an Event list of things that were seen recentlymas_unlockPrompt
- attempts to unlock a Pool Eventmas_findEVL
- gets index of an eventlabel in the event listmas_inEVL
- checks if an eventlabel is in the event listmas_rmEVL
- removes an event label from the event listmas_rmallEVL
- removes all occurrences of an event label from event list
global (import_ddlc)
1 function lol
functions
- dumpPersistentToFile - does what it says
config (options)
key configuration vars
gui (options)
key gui vars
build (options)
build settings
preferences (options)
key preferences
global (pong)
pong's displayable as well as other pong-stuff
imports
- random
- math
classes
- PongDisplayable - displayable that runs pong
global (progression)
key functions for xp system
functions
- grant_xp - give some experience
- get_level - returns the user's current level
global (screens)
a couple of functions
functions
- RigMouse - aka the mouse movement glitch
- FinishEnterName
- FileActionMod - shows that save dialogue thing
mas_layout (screens)
Inits constants for layout adjustments, and some helper functions for them too
imports
- store
- mas_affection
constants
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
global (script-affection)
affection state vars, the final farewell displayable, surprise text code
vars
mas_curr_affection
- current affection statemas_curr_affection_group
- current affection state group
classes
- MASFinalNoteDisplayable - displayable for the final farewell poem
global (script-apology)
just apology related functions
functions
mas_checkApologies
- checks apologies and removes old ones
global (script-ch30)
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.
imports
- subprocess
- os
- eliza
- datetime
- battery
- re
- songs
hkb_button
mas_globals
vars
morning_flag
- True if it's currently morning, False if not. this is more like a previous state var.
functions
show_dialogue_box
- jumps to the talk menupick_game
- jumps to Play menumas_enable_quitbox
- enables monika's quit dialogue warningmas_disable_quitbox
- disables monika's quit dialogue warningmas_enable_quit
- enables quitting without monika knowingmas_disable_quit
- disables quitting without monika knowingmas_drawSpaceroomMasks
- draws the approrpriate window masksshow_calendar
- shows the calendar. this is the callback for clicking the calendar buttonslow_dismiss
- callback for when Monika talksmas_isMorning
- checks if it's currently morningmas_shouldRain
- checks if it should rain based on current affectionmas_forceRain
- forces rain art, sounds, and locks rain topicsmas_lockHair
- locks hair topicsmas_resetIdleMode
- resets idle mode varsmas_enableTextSpeed
- enables text speedmas_disableTextSpeed
- disables text speedmas_resetTextSpeed
- enables or disables text speed depending on environment varsmas_isTextSpeedEnabled
- returns True if text speed is enabled, False if notmas_isGameUnlocked
- checks if given game is unlockedmas_unlockGame
- unlocks the given gamemas_shouldChangeTime
- checks if we should change to day or nightmas_check_player_derand
- checks saved derandom prefs and derandoms those topics
gmr (script-greetings)
Stuff related to the Listen option in the opendoor greeting
vars
- eardoor - list of unseen (or all) Listen options
eardoor_all
- list of all the Listen options
opendoor (script-greetings)
Stuff related to the opendoor greeting
constants
MAX_DOOR
- I dont remember what this is forchance
- 1 out of x chance this greeting will appear
script-topics
)
global (bookmark and derandom functions
functions
mas_derandom_topic
- derandoms a topicmas_bookmark_topic
- bookmarks a topicmas_hasBookmarks
- checks if we have bookmarked topics
global (shake)
We dont use this
global (splash)
Splash messages are defined here
global (sprite-chart)
All of Monika's images are defined here
mas_coffee
(sprite-chart)
Coffee-related vars are defined here
mas_updater
(updater)
inits a ton of updater related stuff
constants
- regular - update link
- unstable - unstable link
- timeout - timeout for update checking
vars
- force - set to True to force an update check
functions
- checkUpdate - checks for an update using Renpy's update checker
global (updates)
functions related to update script migrations
functions
- removeTopicID - unsees a topic if it has been seen
mas_eraseTopic
- removes an Event from its persistent database and lock dbmas_transferTopic
- transfers an Event's data and lock db data to another Eventmas_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
updates (updates_topics)
mapping system for update script migrations
vars
version_updates
- dict that maps a version to its next update versiontopics
- dict that maps a version to the topic adjustments it requires
global (zz_calendar)
declares some runtime functions, adds Repeatables to the calendar.
imports
- mas_calendar
functions
mas_calDropOverlayShield
- enables input for the calendar overlaymas_calHideOverlay
- hides the calendar overlaymas_calIsVisible_ovl
- checks if the calendar overlay is visiblemas_calRaiseOverlayShield
- disables input for the calendar overlaymas_calShowOverlay
- shows the calendar overlay, if not already showing
mas_dockstat
(zz_dockingstation
)
not core, but still important functions
imports
store
cPickle
functions
setMoniSize
- does some calculating to figure out the appropriate Monika filesize
zz_hotkeys
)
global (basically all the hotkey-related functions are here. I'm only listing the public ones.
functions
mas_HKRaiseShield
- disables the t/m/p hotkeysmas_HKDropShield
- enables the t/m/p hotkeysmas_HKIsEnabled
- checks if the t/m/p hotkeys are enabledmas_HKCanQuietMusic
- checks if we can lower or stop the musicenable_esc
- enables the game menu / escape key (viaquick_menu
)disable_esc
- disables the game menu / escape key (viaquick_menu
)set_keymaps
- inits the keymaps
zz_hotkey_buttons
)
global (inits runtime hotkey button functions, as well as shows the buttons
functions
HKBHideButtons
- hides the buttonsHKBShowButtons
- shows the buttonsmas_HKBRaiseShield
- disables the buttonsmas_HKBDropShield
- enables the buttonsmas_HKBIsEnabled
- checks if the buttons are enabledmas_HKBIsVisible
- checks if the buttons are visibleMovieOverlayHideButtons
- hides movie buttonsMovieOverlayShowButtons
- shows movie buttons
zz_music_selector
)
global (declars music-related functions
imports
- songs
functions
dec_musicvol
- decreases music channel volumeinc_musicvol
- increases music channel volumemute_music
- mutes music channelplay_song
- plays a song onto the music channelmas_startup_song
- starts playing thepersistent
.current_trackselect_music
- runs the music selection menu
mas_poems
(zz_poems
)
defines poems database
zz_shields
)
global (defines shield functions
functions
mas_DropShield_core
- enables core interactionsmas_RaiseShield_core
- disables core interactionsmas_DropShield_dlg
- enables dialogue-breaking interactionsmas_RaiseShield_dlg
- disables dialogue-breaking interactionsmas_DropShield_mumu
- enables music-menu-breaking interactionsmas_RaiseShield_mumu
- disables music-menu-breaking interactionsmas_DropShield_idle
- enables idle-breaking interactionsmas_RaiseShield_idle
- disables idle-breaking interactionsmas_MUMUDropShield
- enables the music menumas_MUMURaiseShield
- disables the music menumas_dlgToIdleShield
- transitions between dlg and idle modemas_coreToIdleShield
- transitions between core and idle modemas_mumuToIdleShield
- transitions between music menu and idle mode
zz_reactions
)
global (Public versions of some key reaction functions
functions
addReaction
- adds file reactionsmas_checkReactions
- checks file reactionsmas_getSpriteObjInfo
- gets sprite info from sprite reactions listmas_finishSpriteObjInfo
- cleanup actions for sprite reactions
global
(zz_weather
)
functions for rolling weather chances
functions
shouldRainToday
- checks if it should rain today
global
(zz_windowreacts
)
checks for window reactability
imports
os
sys
- windows onlywin32gui
- windows onlywin32api
- windows onlyballoontip
- nix only
vars
win_notif_quips
- notification quips for windowsother_notif_quips
- notification quips for nix
functions
mas_canCheckActiveWindow
- checks if we can check the active windowmas_getActiveWindow
- gets the active window namemas_isFocused
- checks if MAS is currently focusedmas_isInActiveWindow
- checks if keywords are in the active window namemas_clearNotifs
- clears notifications that we generatedmas_checkforWindowReacts
- checks if a windowreaction should occur and queues itmas_resetWindowReacts
- unlocks window reactions in window react dbmas_updateFilterDict
- updates filter dictmas_addBlacklistReact
mas_removeBlacklistReact
mas_notifsEnabledforGroup
- checks if notifications are enabled for a groupmas_unlockFailedWRS
- unlocks a window react if it failed to be shownmas_tryShowNotificationOSX
- trys to show a notification on macmas_tryShowNotificationLinux
- trys to show a notification on linux
1
mas_chess (chess)
huge number of chess constants, chess dialogue vars, as well as chess checking functions. Also initializes the dialogue actions map and the chess quiplists
imports
os
chess.png
vars
quit_game
- enables quitting a chess match
functions
isInProgressGame
- checks if a pgn game is valid and in progress
global (defintions)
Properly sets persistent.steam
mas_randchat (definitions)
Sets up the random chatter functions and constants
functions
adjustRandFreq
- adjusts random chatter frequency given a slider valuegetRandChatDisp
- converts random chatter frequency into a display string
evhand (event-handler)
Core action functions for Event
's usage. All of this stuff should be internal only.
2
global (definitions)
Creates coffee related functions, also various other functions
functions
mas_brewCoffee
- starts brewing coffeemas_drinkCoffee
- starts drinking coffeemas_isCoffeeTime
- checks if its coffee timemas_resetCoffee
- resets coffee varsmas_canShowRisque
- checks if we can show risque contentmas_getPlayerAge
- gets the player agemas_getRPYFiles
- gets list of rpy files in the game dirmas_hasRPYFiles
- checks if there are rpy files in the game dirmas_is18Over
- checks if the player is over 18mas_isFirstSeshDay
- checks if given date is the first session datemas_pastOneDay
- checks if a one day has passed since a givendatetime.date
ordatetime.datetime
mas_timePastSince
- checks if a given amount of time passed since a givendatetime.date
ordatetime.datetime
global (script-affection)
Creates the final farewell poem
4
global (definitions)
makes the mas_randchat
store globally available
global
(event-handler
)
Maps event databases to codes and cleans yearset baclkist
functions
mas_lastSeenInYear
- checks if an event label was last seen in a given yearmas_lastSeenLastYear
- checks if an event label was last seen last year
mas_gtod
(script-grammar
)
grammar tip helper functions
imports
datetime
evhand
functions
has_day_past_tip
- checks if a tip has been seen and a day has past
global (script-holidays)
Poems are defined here
global
(script-islands-event
)
adjust islands flag if needed
mas_ptod
(script-python
)
declares helper functions for python tips
imports
datetime
evhand
functions
has_day_past_tip
- checks if a tip has been seen and a day has pasthas_day_past_tips
- multiple arg version of above function
global (updates)
Runs pre-script topics update code. Not really used
mas_calendar
(zz_calendar
)
calendar functions and season setting
functions
addSeasonEvents
- adds seasons to calendar
5
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.
6
global
(event-handler
)
Creates all event database, also key functions
functions
mas_getEV
- gets an event object via labelmas_getEVCL
- only for calendar use.mas_hideEVL
- hides an event, using a code to determine databasemas_lockEVL
- locks an event, using a code to determine databasemas_showEVL
- shows an event, using a code to determine databasemas_stripEVL
- strips conditional and action from an event, also removes from event listmas_unlockEVL
- unlocks an event, using a code to determine database`
9
global (updates_topics)
Runs the label that inits the updates
store with update mapping data.
10
mas_anni (script-anniversary)
Sets up anniversary database as well as key anniversary adjusting functions
constants
ANNI_LIST
- list of anniversaries in order of potential appearance
vars
anni_db
-Event
database for anniversaries
functions
_month_adjuster
- adjusts months for a new start date_day_adjuster
- adjust days for a new start dateadd_cal_annis
- adds anniversaries to the calendarclean_cal_annis
- cleans anniversaries from the calendarreset_annis
- resets all anniversaries using a new start dateunlock_past_annis
- unlocks all anniversaries that are past the current date
global (script-greetings)
This is just for the Listen option for the greetings. It removes seen labels and does resets if necessary.
global (updater)
Declares the background update check function
functions
mas_backgroundUpdateCheck
- launches the background update check thread
global (updates)
Runs the version update migration scripts.
zz_hangman
)
global (Inits the wordlists for hangman
songs (zz_music_selector)
sets music_volume
to the current volume of the music channel
global (zz_music_selector)
Properly sets the custom music directory, current track and the available music choices.
zz_poems
)
global (defines MASPoem
class
zz_weather
)
global (Weather class
classes
MASWeather
- weather object class
11
global (script-topics)
Initializes the seen lists. They are not built until later.
vars
mas_rev_unseen
- list of unseenEvent
smas_rev_seen
- list of seenEvent
smas_rev_mostseen
- list of most seenEvent
s
mas_poems
(zz_poems
)
defines key poem-realted functions
15
mas_affection
(script-affection
)
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.
imports
store
evhand
mas_layout
functions
NOTE: Most of these are programming points. No need to list them here
runAffPPs
- runs the affection state programming pointsrunAffGPPs
- runs the affection state group programming points
20
global (script-affection)
Declares all the globally available affection functions and poems
imports
datetime
mas_affection
mas_utils
vars
mas_apology_reason
- the reason to apologize
functions
mas_FreezeGoodAffExp
- freezes affection gainsmas_FreezeBadAffExp
- freezes affection lossesmas_FreezeBothAffExp
- freezes affection gains and lossesmas_UnfreezeGoodAffExp
- unfreezes affection gainsmas_UnfreezeBadAffExp
- unfreezes affection lossesmas_UnfreezeBothAffExp
- unfreezes affection gains and lossesmas_betweenAff
- checks if affection is between 2 statesmas_compareAff
- compare-to function for comparing affection statesmas_compareAffG
- compare-to function for comparing affection group statesmas_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 appropriatemas_gainAffection
- increases affectionmas_loseAffection
- decreases affectionmas_setAffection
- sets affection to a valuemas_checkAffection
- pushes an appropriate event based on affection levelmas_setApologyReason
- enables an apology_mas_getAffection
- gets raw affection value_mas_getBadExp
- gets bad aff exp setting_mas_getGoodExp
- gets good aff exp setting_mas_getTodayExp
- gest today aff exp setting
21
mas_sprites_json
(zz_spritejsons
)
Initializes key sprite json related constants
imports
json
store
mas_utils
constants
SP_ACS
- sprite type for ACSSP_HAIR
- sprite type for hairSP_CLOTHES
- sprite type for clothesSP_CONSTS
- tuple of all spriet typesSP_STR
- sprite type to string name mapping (for debug use)SP_UF_STR
- sprite type user friendly string name mappingSP_PP
- sprite type to prog point formatSP_RL
- sprite type to reaction label format
vars
giftname_map
- maps giftnames to sprite type and namenamegift_map
- maps sprite type and name to giftname
100
global (screens)
sets up the appropriate layout vars for ui text
global (zz_calendar)
declars a function for adjusting the conditional of the start date Event
functions
mas_chgCalEVul
- literally just changes conditional for the state dateEvent
189
mas_sprites_json
(zz_spritejsons
)
json parsing functions
imports
mas_sprites
assms
mas_selspr
assml
190
mas_sprites_json
(zz_spritejsons
)
Checks for JSON sprites and adds them
200
mas_dockstat
(zz_dockingstation
)
Declares Monika's dockingstation function
imports
store
cStringIO
os
mas_greetings
mas_ics
mas_sprites
evhand
random
datetime
threading
functions
generateMonika
- generates monika's new character filefindMonika
- finds Monika's character fileinit_findMonka
- find Monika, init versionparseMoniData
- parses monika character file data into componentsselectReturnHomeGreeting
- picks an appropriate greeting if we are returning monika to characters folderdiffCheckTimes
- returns a timedelta difference between last checkin/checkout timespackageCheck
- more generic package checking function that can do eithersignForPackage
andcreatePackageSlip
checkinMonika
- checks Monika into the docking stationcheckoutMonika
- checks Monika out of the docking stationgetCheckTimes
- gets a corresponding checkin/checkout time for a given checksum
mas_selspr
(zz_selector
)
Loads selectable data.
205
mas_dockstat
(zz_dockingstation
)
Declares async promises.
imports
mas_threading
vars
monikagen_promise
-MASAsyncWrapper
object for generation Monikamonikafind_promise
-MASAsyncWrapper
object for finding Monika
functions
abortGenPromise
- specifically aborts the generation promise in case we aborted it.
500
All images are built at this init level.
501
global (zz_overlays)
Declares overlay-related functions
functions
mas_OVLDropShield
- enables all overlay screensmas_OVLHide
- hides all overlay screensmas_OVLRaiseShield
- disables all overlay screensmas_OVLShow
- shows all overlay screens
790
mas_piano_keys (zz_pianokeys)
Holds the functions for adding JSON songs to piano
imports
json
functions
addSong
- adds a song to thePianoNoteMatchList
databaseaddCustomSongs
- parses the custom song folder for songs and adds them to thePianoNoteMatchList
databaseaddStockSongs
- adds a preset list of songs to thePianoNoteMatchList
database
800
zz_backgrounds
)
global (background changing functions
mas_piano_keys
(zz_pianokeys
)
Adds the stock and custom songs to the PianoNoteMatchList
database. Also declares a function for generating the piano song menu.
functions
getSongChoices
- generates a list of tuples for the piano song selection menu
zz_reactions
)
global (Deletes files of reactions that failed to be deleted.
zz_weather
)
global (Global weather functions, as well as setting the initial weather
functions
mas_setWeather
- sets the weather without calling exit programming pointsmas_changeWeather
- sets the weather calling both entry and exit programming points
810
global (zz_pianokeys)
Creates the piano displayable
imports
mas_piano_keys
classes
PianoDisplayable
- displayable that runs the piano
functions
pnmlLoadTuples
- loadsPianoNoteMatchList
data frompersistent
into corresponding objects in thePianoNoteMatchList
databasepnmlSaveTuples
- savesPianoNoteMatchList
data intopersistent
from corresponding objects in thePianoNoteMatchList
database
899
global (chess)
inits the chess quiplist
900
In general, all DelayedAction constructor functions are built here.
global (screens)
Inits the quit messages for layout
970
global (script-ch30)
Checks for:
- monika's file
- file reactions
- bday stuff
- o31 stuff
imports
mas_filereacts
994
mas_delact (event-handler)
Sets up the DelayedAction map
constants
MAP
- Maps DelayedAction IDs to constructor functions
functions
loadDelayedActionMap
- generates the runtime map of DelayedActions frompersistent
saveDelayedActionMap
- saves the runtime map of DelayedActions topersistent
995
global (event-handler)
Runs DelayedActions at the init stage
999
global (updates)
Runs the late update scripts