Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New greeting, new clothes and hair, and hair sprite adjustments #6915

Merged
merged 29 commits into from
Feb 21, 2022
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
b6e9a19
We don't need these here anymore
Booplicate Jan 12, 2021
bf9e842
remove damn white pixels from the def hair
Booplicate Jan 20, 2021
34f8877
Merge remote-tracking branch 'upstream/content' into wet_monika
Booplicate Jan 20, 2021
a0b6134
more white pixels
Booplicate Jan 20, 2021
c585f0c
Added wet stuff
Booplicate Jan 20, 2021
72123f4
this is gonna be big
Booplicate Jan 20, 2021
cae4f16
I think this is done
Booplicate Jan 22, 2021
c6602cd
conflicts
multimokia Mar 16, 2021
6eae4f2
moni has bedhair and now less redhair
multimokia Mar 16, 2021
5a62395
confliccs
multimokia Apr 1, 2021
3f82d2a
dont disable the selectors + a few fixes
Booplicate Apr 2, 2021
ae71352
naming
Booplicate May 23, 2021
4d7c39e
Merge remote-tracking branch 'upstream/content' into wet_monika
Booplicate May 30, 2021
bd1290c
Merge remote-tracking branch 'upstream/content' into wet_monika
Booplicate Jun 12, 2021
32f4872
req + some adj
Booplicate Jun 12, 2021
38b8548
Merge remote-tracking branch 'upstream/content' into wet_monika
Booplicate Jul 6, 2021
48060a6
smol dlg things
multimokia Sep 6, 2021
7e1ee26
Merge remote-tracking branch 'upstream/content' into wet_monika
Booplicate Oct 6, 2021
17f1bff
Merge remote-tracking branch 'upstream/content' into wet_monika
Booplicate Jan 30, 2022
f753dd4
resolved todo
Booplicate Feb 19, 2022
b5c6603
Merge remote-tracking branch 'upstream/content' into wet_monika
Booplicate Feb 19, 2022
3c26e43
Better exceptions
Booplicate Feb 19, 2022
c6b16d9
smol dialogue things
multimokia Feb 20, 2022
e401218
limit to ~daytime
Booplicate Feb 20, 2022
f494f43
the flower pin must glow
Booplicate Feb 20, 2022
2506e02
Merge branch 'wet_monika' of https://github.com/Booplicate/MonikaModD…
Booplicate Feb 20, 2022
b185e6c
wow who coded this
Booplicate Feb 20, 2022
b51c32b
Implement proper accessors
Booplicate Feb 20, 2022
8db7a7c
sanity check
Booplicate Feb 20, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions Monika After Story/game/event-rules.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ init -1 python:
EV_RULE_AFF_RANGE = "affection_range"
EV_RULE_PRIORITY = "rule_priority"
EV_RULE_PROBABILITY = "rule_probability"
EV_RULE_RP_TIMEDELTA = "rp_timedelta"


# special constants for numerical repeat rules
Expand Down Expand Up @@ -795,6 +796,72 @@ init -1 python:
"""
return ev.rules.get(EV_RULE_PROBABILITY, MASProbabilityRule.DEF_PROBABILITY)

class MASTimedeltaRepeatRule(object):
"""
Static class used to create repeat rules.
Timedelta repeat rules allow events to be repeated only every 'timedelta' since their last seen.
"""
@staticmethod
def create_rule(timedelta, ev=None):
"""
IN:
timedelta - the timedelta to set

ev - the event to add this rule to
(Default: None)

OUT:
dict containing the rule
"""
if not isinstance(timedelta, datetime.timedelta):
raise TypeError(
"Expected a datetime.timedelta object, got: '{0}'.".format(timedelta)
)

elif not timedelta:
raise ValueError(
"Expected a datetime.timedelta object with a non-null value."
)

rule = {EV_RULE_RP_TIMEDELTA: timedelta}

if ev:
ev.rules.update(rule)

return rule

@staticmethod
def evaluate_rule(event=None, rule=None, now=None):
"""
Evaluates a MASTimedeltaRepeatRule rule

IN:
event - the event to evaluate
rule - the timedelta of the MASTimedeltaRepeatRule to check against,
if None, we get it from the event
(Default: None)
now - time to check against, if None, datetime.datetime.now() is used
(Default: None)

OUT:
boolean whether or not the event's passed
"""
# No event, no deal
if event is None:
return False

if rule is None:
rule = event.rules.get(EV_RULE_RP_TIMEDELTA, None)

# Empty timedelta? You passed
if not rule:
return True

if now is None:
now = datetime.datetime.now()

return event.timePassedSinceLastSeen_dt(rule, now)

init python:
# these rules are NOT actually event rules since they don't create rule
# data in Event.
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions Monika After Story/game/script-ch30.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -2086,6 +2086,22 @@ label ch30_reset:
# build background filter data and update the current filter progression
$ store.mas_background.buildupdate()

# Handle cleanup for the bath greeting
$ bath_cleanup_ev = mas_getEV("mas_after_bath_cleanup")
if (
bath_cleanup_ev is not None
and bath_cleanup_ev.start_date is not None
):
# Moni was alone for at least 10 minutes
# And it is the time to run the cleanup event
if (
mas_dockstat.retmoni_status is None
and mas_getAbsenceLength() >= datetime.timedelta(minutes=10)
and bath_cleanup_ev.start_date > datetime.datetime.now()
):
call mas_after_bath_cleanup_change_outfit
$ mas_stripEVL("mas_after_bath_cleanup", list_pop=True, remove_dates=True)

#set MAS window global
$ mas_windowutils._setMASWindow()

Expand Down
1 change: 1 addition & 0 deletions Monika After Story/game/script-farewells.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ init -1 python in mas_farewells:
store.MASSelectiveRepeatRule.evaluate_rule(check_time, ev, defval=True)
and store.MASNumericalRepeatRule.evaluate_rule(check_time, ev, defval=True)
and store.MASGreetingRule.evaluate_rule(ev, defval=True)
and store.MASTimedeltaRepeatRule.evaluate_rule(ev)
):
return False

Expand Down
243 changes: 212 additions & 31 deletions Monika After Story/game/script-greetings.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,13 @@ init -1 python in mas_greetings:

# rule checks
if not (
store.MASSelectiveRepeatRule.evaluate_rule(
check_time, ev, defval=True)
and store.MASNumericalRepeatRule.evaluate_rule(
check_time, ev, defval=True)
and store.MASGreetingRule.evaluate_rule(ev, defval=True)
):
store.MASSelectiveRepeatRule.evaluate_rule(
check_time, ev, defval=True)
and store.MASNumericalRepeatRule.evaluate_rule(
check_time, ev, defval=True)
and store.MASGreetingRule.evaluate_rule(ev, defval=True)
and store.MASTimedeltaRepeatRule.evaluate_rule(ev)
):
return False

# conditional check
Expand Down Expand Up @@ -1626,6 +1627,39 @@ label monikaroom_greeting_ear_renpy_docs:

jump monikaroom_greeting_choice

init 5 python:
gmr.eardoor.append("monikaroom_greeting_ear_recursionerror")

label monikaroom_greeting_ear_recursionerror:
m "Hmm, now that looks good. Let's-{w=0.5}{nw}"
m "Wait, no. Gosh, how did I forget..."
m "This has to be called right here."

python:
for loop_count in range(random.randint(2, 3)):
renpy.say(m, "Great! Alright, let's see...")

show noise
play sound "sfx/s_kill_glitch1.ogg"
pause 0.1
stop sound
hide noise

m "{cps=*2}What?!{/cps} {w=0.25}A RecursionError?!"
m "'Maximum recursion depth exceeded...'{w=0.7} How is this even happening?"
m "..."

if mas_isMoniUpset():
m "...Keep going, Monika, you'll figure this out."
call monikaroom_greeting_ear_prog_upset
elif mas_isMoniDis():
m "...Keep{w=0.1} it{w=0.1} going{w=0.1}, Monika. You {i}have{/i} to do this."
call monikaroom_greeting_ear_prog_dis
else:
m "Phew, at least everything else is fine."

jump monikaroom_greeting_choice

## ear door processing
init 10 python:

Expand Down Expand Up @@ -4297,7 +4331,7 @@ label greeting_back_from_hangout:
return

init 5 python:
ev_rules = {}
ev_rules = dict()
ev_rules.update(
MASGreetingRule.create_rule(
random_chance=3,
Expand Down Expand Up @@ -4368,38 +4402,185 @@ label greeting_spacing_out:
m 1hubsb "Ahaha~"
m 1eua "I'm very happy to see you again. {w=0.2}{nw}"
extend 3eua "What should we do today, [player]?"

return

init 5 python:
gmr.eardoor.append("monikaroom_greeting_ear_recursionerror")
ev_rules = dict()
ev_rules.update(
MASGreetingRule.create_rule(
skip_visual=True,
random_chance=20,
override_type=True
)
)
ev_rules.update(
MASTimedeltaRepeatRule.create_rule(
datetime.timedelta(days=3)
)
)

label monikaroom_greeting_ear_recursionerror:
m "Hmm, now that looks good. Let's-{w=0.5}{nw}"
m "Wait, no. Gosh, how did I forget..."
m "This has to be called right here."
addEvent(
Event(
persistent.greeting_database,
eventlabel="greeting_after_bath",
conditional=(
"mas_getAbsenceLength() >= datetime.timedelta(hours=6) "
"and not mas_isSpecialDay()"
),
unlocked=True,
rules=ev_rules,
aff_range=(mas_aff.LOVE, None)
),
code="GRE"
)

del ev_rules

init 1:
# NOTE this should be defined AFTER init 0
# NOTE: default may be not completely reliable, always save the snapshot yourself
default persistent._mas_previous_moni_state = monika_chr.save_state(True, True, True, True)

label greeting_after_bath:
python hide:
# Some preperations
mas_RaiseShield_core()
mas_startupWeather()
# Save current outfit
persistent._mas_previous_moni_state = monika_chr.save_state(True, True, True, True)
# Now let Moni get a towel
monika_chr.change_clothes(
random.choice(MASClothes.by_exprop(mas_sprites.EXP_C_WET, None)),
by_user=False,
outfit_mode=True
)
# In case the towel already set an appropriate hair, we don't change it
if not monika_chr.is_wearing_hair_with_exprop(mas_sprites.EXP_H_WET):
monika_chr.change_hair(mas_hair_wet, by_user=False)
# We leave this acs to the clothes PPs in case the towel we chose doesn't support it
# if not monika_chr.is_wearing_acs(mas_acs_water_drops):
# monika_chr.wear_acs(mas_acs_water_drops)
# Setup the cleaup event
mas_setEVLPropValues(
"mas_after_bath_cleanup",
start_date=datetime.datetime.now() + datetime.timedelta(minutes=random.randint(30, 90)),
action=EV_ACT_QUEUE
)
mas_startup_song()

# Now show everything
call spaceroom(hide_monika=True, dissolve_all=True, scene_change=True, show_emptydesk=True)

$ renpy.pause(random.randint(5, 15), hard=True)
call mas_transition_from_emptydesk("monika 1huu")
$ renpy.pause(2.0)
$ quick_menu = True

m 1wuo "Oh! {w=0.2}{nw}"
extend 2wuo "[player]! {w=0.2}{nw}"
extend 2lubsa "I was thinking about you."

$ bathing_showering = random.choice(("bathing", "showering"))

if mas_getEVL_shown_count("greeting_after_bath") < 5:
m 7lubsb "I just finished [bathing_showering]...{w=0.3}{nw}"
extend 1ekbfa "you don't mind me being in my towel, do you?~"
m 1hubfb "Ahaha~"
m 3hubsa "I'll get ready soon, let me wait for my hair to dry off a little more first."

# Gets used to it
else:
m 7eubsb "I just finished [bathing_showering]."

if mas_canShowRisque() and random.randint(0, 3) == 0:
m 1msbfb "I bet you wish you could've joined me there..."
m 1tsbfu "Well, maybe one day~"
m 1hubfb "Ahaha~"

else:
m 1eua "I'll get dressed soon~"

python:
for loop_count in range(random.randint(2, 3)):
renpy.say(m, "Great! Alright, let's see...")
# enable music menu and music hotkeys
mas_MUINDropShield()
# keymaps should be set
set_keymaps()
# show the overlays
mas_OVLShow()

show noise
play sound "sfx/s_kill_glitch1.ogg"
pause 0.1
stop sound
hide noise
del bathing_showering

m "{cps=*2}What?!{/cps} {w=0.25}A RecursionError?!"
m "'Maximum recursion depth exceeded...'{w=0.7} How is this even happening?"
m "..."
return

# NOTE: This is not a greeting, but a followup for the greeting above, so I decided to keep them together
init 5 python:
addEvent(Event(persistent.event_database, eventlabel="mas_after_bath_cleanup", show_in_idle=True, rules={"skip alert": None}))

label mas_after_bath_cleanup:
# Sanity check (checking for towel should be enough)
if (
not monika_chr.is_wearing_clothes_with_exprop(mas_sprites.EXP_C_WET)
and not monika_chr.is_wearing_hair_with_exprop(mas_sprites.EXP_H_WET)
):
return

if mas_globals.in_idle_mode or (mas_canCheckActiveWindow() and not mas_isFocused()):
m 1eua "I'm going to get dressed.{w=0.3}.{w=0.3}.{w=0.3}{nw}"

if mas_isMoniUpset():
m "...Keep going, Monika, you'll figure this out."
call monikaroom_greeting_ear_prog_upset
elif mas_isMoniDis():
m "...Keep{w=0.1} it{w=0.1} going{w=0.1}, Monika. You {i}have{/i} to do this."
call monikaroom_greeting_ear_prog_dis
else:
m "Phew, at least everything else is fine."
m 1eua "Give me a moment [mas_get_player_nickname()], {w=0.2}{nw}"
extend 3eua "I'm going to get dressed."

jump monikaroom_greeting_choice
window hide
call mas_transition_to_emptydesk

$ renpy.pause(1.0, hard=True)
call mas_after_bath_cleanup_change_outfit
$ renpy.pause(random.randint(10, 15), hard=True)

call mas_transition_from_emptydesk("monika 3hub")
window auto

if mas_globals.in_idle_mode or (mas_canCheckActiveWindow() and not mas_isFocused()):
m 3hub "All done!{w=1}{nw}"

else:
m 3hub "Alright, I'm back!~"
m 1eua "So what would you like to do today, [player]?"

return

label mas_after_bath_cleanup_change_outfit:
# TODO: Rng outfit selection wen
python hide:
if monika_chr.is_wearing_clothes_with_exprop(mas_sprites.EXP_C_WET):
prev_clothes = mas_sprites.get_sprite(mas_sprites.SP_CLOTHES, persistent._mas_previous_moni_state[0])
# Fallback just in case
if prev_clothes is None or prev_clothes.hasprop(mas_sprites.EXP_C_WET):
if mas_isMoniHappy(higher=True):
prev_clothes = mas_clothes_blazerless

else:
prev_clothes = mas_clothes_def

monika_chr.change_clothes(
prev_clothes,
by_user=False,
outfit_mode=True
)

if monika_chr.is_wearing_hair_with_exprop(mas_sprites.EXP_H_WET):
# I think it's better to always select new random hair, even after using outfit mode
prev_hair = random.choice(
[
hair_obj
for hair_obj in mas_sprites.HAIR_MAP.itervalues()
if not hair_obj.hasprop(mas_sprites.EXP_H_WET) and mas_sprites.is_clotheshair_compatible(monika_chr.clothes, hair_obj)
]
)
monika_chr.change_hair(
prev_hair,
by_user=False
)

return
Loading