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

some 922 fixes #7889

Merged
merged 18 commits into from
Feb 21, 2022
74 changes: 61 additions & 13 deletions Monika After Story/game/script-holidays.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -6902,19 +6902,47 @@ init -1 python:
def mas_isMonikaBirthday(_date=None):
"""
checks if the given date is monikas birthday
Comparison is done solely with month and day

converts date to datetime and runs thru mas_isMonikaBirthday_dt
jmwall24 marked this conversation as resolved.
Show resolved Hide resolved
IN:
_date - date to check. If not passed in, we use today.
"""
if _date is None:
_date = datetime.date.today()

return (
_date.month == mas_monika_birthday.month
and _date.day == mas_monika_birthday.day
_datetime = datetime.datetime.combine(_date, datetime.time())

return mas_isMonikaBirthday_dt(_datetime=_datetime)


def mas_isMonikaBirthday_dt(_datetime=None, _extend=0):
"""
checks if the given date is monikas birthday
jmwall24 marked this conversation as resolved.
Show resolved Hide resolved

IN:
_datetime - datetime to check. If not passed in, we use now.
_extend - int of how many hours we want to extend past 922
defaults to 0
"""
if _datetime is None:
_datetime = datetime.datetime.now()
jmwall24 marked this conversation as resolved.
Show resolved Hide resolved

is_bday = (
_datetime.month == mas_monika_birthday.month
and _datetime.day == mas_monika_birthday.day
)

if _extend > 0:
return (
is_bday
or (
_datetime.month == mas_monika_birthday.month
and _datetime.day == mas_monika_birthday.day + 1
and _datetime.hour < _extend
)
)

return is_bday
jmwall24 marked this conversation as resolved.
Show resolved Hide resolved


def mas_getNextMonikaBirthday():
today = datetime.date.today()
Expand Down Expand Up @@ -7150,7 +7178,7 @@ init 5 python:
action=EV_ACT_UNLOCK,
rules={"no_unlock": None},
start_date=mas_monika_birthday,
end_date=mas_monika_birthday + datetime.timedelta(days=1),
end_date=datetime.datetime.combine(mas_monika_birthday+datetime.timedelta(days=1), datetime.time(hour=1)),
jmwall24 marked this conversation as resolved.
Show resolved Hide resolved
years=[]
),
code="CMP",
Expand All @@ -7169,8 +7197,14 @@ label mas_bday_pool_happy_bday:
$ mas_gainAffection(5,bypass=True)
if mas_recognizedBday():
m 3hub "Ehehe, thanks [player]!"
m 3eka "I was waiting for you to say those magic words~"
m 1eub "{i}Now{/i} we can call it a birthday celebration!"

if persistent._mas_bday_said_happybday:
m 3eka "First you sang it to me and now you've said it..."

else:
m 3eka "I was waiting for you to say those magic words~"
m 1eub "{i}Now{/i} we can call it a birthday celebration!"

m 1eka "You really made this occasion so special, [player]."
m 1ekbsa "I can't thank you enough for loving me this much..."

Expand Down Expand Up @@ -7390,8 +7424,8 @@ init 5 python:
Event(
persistent.event_database,
eventlabel="mas_bday_spent_time_with",
conditional="mas_recognizedBday()",
action=EV_ACT_QUEUE,
conditional="mas_recognizedBday() and not mas_lastSeenInYear('mas_bday_spent_time_with_wrapup')",
action=EV_ACT_PUSH,
start_date=datetime.datetime.combine(mas_monika_birthday, datetime.time(18)),
end_date=datetime.datetime.combine(mas_monika_birthday+datetime.timedelta(days=1), datetime.time(hour=3)),
years=[]
Expand All @@ -7407,7 +7441,6 @@ label mas_bday_spent_time_with:
m 1eud "Well it gives me hope that maybe it's not too late for us."
m "Perhaps today can be the start of something really special.."
m 3eka "That would be the be the best gift I could ever ask for."
return

else:
$ _timeout = store.mas_dockstat.timeOut(mas_monika_birthday)
Expand All @@ -7422,8 +7455,22 @@ label mas_bday_spent_time_with:
m 1ekbsa "Well, it truly means a lot to me."
m 3ekbsa "You really made my birthday complete~"

$ pushEvent('mas_bday_spent_time_with_wrapup', skipeval=True)

return


init 5 python:
addEvent(
Event(
persistent.event_database,
eventlabel="mas_bday_spent_time_with_wrapup"
)
)

label mas_bday_spent_time_with_wrapup:
$ mas_rmallEVL("mas_bday_spent_time_with")
$ mas_rmallEVL("mas_bday_postbday_notimespent")
$ gave_gifts = mas_getGiftStatsRange(mas_monika_birthday, mas_monika_birthday + datetime.timedelta(days=1))[0]

if gave_gifts > 0:
Expand All @@ -7439,6 +7486,7 @@ label mas_bday_spent_time_with_wrapup:
m 3eka "I know it can't be easy."

m 1dku "..."

if mas_isMoniEnamored(higher=True):
m 1dktpu "..."
m 1ektpu "Ahaha, sorry, [player]!"
Expand Down Expand Up @@ -7514,7 +7562,7 @@ init 5 python:
"and not persistent._mas_bday_gone_over_bday"
),
action=EV_ACT_PUSH,
start_date=mas_monika_birthday+datetime.timedelta(days=1),
start_date=datetime.datetime.combine(mas_monika_birthday+datetime.timedelta(days=1), datetime.time(hour=1)),
end_date=mas_monika_birthday+datetime.timedelta(days=8),
years=[]
),
Expand Down Expand Up @@ -7940,7 +7988,7 @@ label greeting_returned_home_bday:
m 1rka "And it's not just this date..."
m 1eka "You didn't have to take me anywhere to make this a wonderful birthday."
m 3duu "As soon as you showed up, my day was complete."
jump mas_bday_spent_time_with_wrapup
$ pushEvent('mas_bday_spent_time_with_wrapup', skipeval=True)

return

Expand Down
16 changes: 15 additions & 1 deletion Monika After Story/game/updates.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,21 @@ label v0_3_1(version=version): # 0.3.1
# 0.12.5
label v0_12_5(version="v0_12_5"):
python hide:
pass
mas_setEVLPropValues(
"mas_bday_spent_time_with",
action=EV_ACT_PUSH,
conditional="mas_recognizedBday() and not mas_lastSeenInYear('mas_bday_spent_time_with_wrapup')"
)

mas_setEVLPropValues(
"mas_bday_pool_happy_bday",
end_date=datetime.datetime.combine(mas_monika_birthday+datetime.timedelta(days=1), datetime.time(hour=1))
)

mas_setEVLPropValues(
"mas_bday_postbday_notimespent",
start_date=datetime.datetime.combine(mas_monika_birthday+datetime.timedelta(days=1), datetime.time(hour=1))
)
return

# 0.12.4
Expand Down
8 changes: 6 additions & 2 deletions Monika After Story/game/zz_pianokeys.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,9 @@ label mas_piano_def_prac:
label mas_piano_hb_win:
$ mas_gainAffection()
m 1eua "Wow! You almost got it!"
if mas_isMonikaBirthday():
if mas_isMonikaBirthday_dt(_extend = 1):
$ persistent._mas_bday_said_happybday = True
$ persistent._mas_bday_no_recognize = False
if mas_isplayer_bday():
m 3hub "That's so cool being able to sing along while you play that on our birthday, [player]!"
else:
Expand Down Expand Up @@ -300,7 +302,9 @@ label mas_piano_hb_fail:

label mas_piano_hb_fc:
$ mas_gainAffection(modifier=1.5)
if mas_isMonikaBirthday():
if mas_isMonikaBirthday_dt(_extend = 1):
$ persistent._mas_bday_said_happybday = True
$ persistent._mas_bday_no_recognize = False
if mas_isplayer_bday():
m 3hub "Ahaha! That was {i}so{/i} cool!"
m 1eka "Singing the Birthday Song while you play it on the piano on our birthday..."
Expand Down