Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
dreamscached committed Jul 5, 2023
2 parents 47ce3f8 + 7a1f4e0 commit 773e5ff
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 8 deletions.
2 changes: 1 addition & 1 deletion mod/checkup.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ label mshMod_checkup_intro:
if not store._msh_reminder.is_reminder_queued("mshMod_checkup_reminder"):
$ store._msh_reminder.queue_reminder(
_msh_reminder.Reminder(
trigger_at=store._msh_reminder_utils.getWeeklyEveningDelay(),
trigger_at=datetime.datetime.now() + store._msh_reminder_utils.getWeeklyEveningDelay(),
target_evl="mshMod_checkup_reminder",
key="checkup_reminder",
interval=store._msh_reminder_utils.INTERVAL_WEEKLY,
Expand Down
2 changes: 1 addition & 1 deletion mod/header.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ init -990 python in mas_submod_utils:
name="Self Harm Awareness Submod",
description="Awareness about self-harm and support to self-harmers, with different "
"techniques, milestones, checkups and new dialogue and spritepacks.",
version="2.0.1"
version="2.0.2"
)

init -989 python:
Expand Down
46 changes: 41 additions & 5 deletions mod/questions.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,47 @@ label mshMod_probing_questions_talk:
"Yes!":
show monika 5husdlb at t11 zorder MAS_MONIKA_Z with dissolve_monika
m 5husdlb "Oh, yay!"
m 5esa "Can you tell me for how many days have you been sober?{nw}"

call mshMod_sober_ask_since
$ since = _return
m 5esa "Can you tell me since when have you been sober?{nw}"

label .select_since_date:
m 3hub "If you don't remember exactly, it's alright! Pick a day when you think you decided to quit it~"
call mas_start_calendar_select_date
$ since = _return
if not since:
jump .select_nothing
$ since = _return.date()

$ today = datetime.date.today()

if since > today:
m 1hksdla "[player]!"
m 3lksdlb "It's great that you plan on quitting it in future, but I asked you for a day in the past, ahaha!"
m 1hua "Try again!"
jump .select_since_date

# We can do a simplified check for 'honest' date (actually just relying
# on player's conscience) that probably is less than 5 years
if (today - since).days // 365 > 5:
m 3wub "[mas_get_player_nickname(capitalize=True)], it's been a while since that day!"
m 2lksdla "But just to be completely sure...{w=0.3}{nw} "
extend 3wud "Are you absolutely sure you're sober for more than {i}five{/i} years now?{nw}"

$ _history_list.pop()
menu:
m "But just to be completely sure... Are you absolutely sure you're sober for more than {i}five{/i} years now?{fast}"

"Yes!":
m 3hub "Amazing! Alright, I'll write it down right away~"
jump mshMod_sober_promise_jump

"Well, actually...":
m 2dka "It's okay, [mas_get_player_nickname()].{w=0.3} Don't worry!"
jump .select_since_date

if persistent._mas_player_bday and since < persistent._mas_player_bday:
m 1rkb "[mas_get_player_nickname(capitalize=True)]...{w=0.3} The day you chose is before your birthday!"
m 3eka "Try again, please."
jump .select_since_date

show monika 1sub at t11 zorder MAS_MONIKA_Z with dissolve_monika
m 1sub "I'm so proud of you, [mas_get_player_nickname()]."
Expand All @@ -74,7 +111,6 @@ label mshMod_probing_questions_talk:
mas_showEVL("mshMod_sober_check", "EVE", unlock=True)
mas_showEVL("mshMod_sober_relapse", "EVE", unlock=True)


"I don't know.":
m 2eka "Aww, [player], that's okay!"
m 7hub "If you ever want to keep track of it, you can tell me by promising you'll stay self-harm sober."
Expand Down
19 changes: 18 additions & 1 deletion mod/update.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,16 @@ init 5 python:
if not ev.unlocked and ev.last_seen is not None:
ev.unlocked = True

def _mshMod_migrateBrokenReminder(key):
rem_idx = store._msh_reminder.get_reminder(key)
if rem_idx is None:
return

rem = store._msh_reminder.queue[rem_idx]
if isinstance(rem.trigger_at, datetime.timedelta):
store._msh_reminder.pop_reminder(rem_idx, remove=True)
rem.trigger_at = datetime.datetime.now() + rem.trigger_at
store._msh_reminder.queue_reminder(rem)

init 10 python:

Expand Down Expand Up @@ -141,4 +151,11 @@ init 996 python:

if not persistent._msh_mod_sha_migrated and persistent._msh_mod_was_installed:
persistent._msh_mod_sha_migrated = True
_msh_mod_migrated_now = True
_msh_mod_migrated_now = True


init 996 python:

## Fix reminder that was broken until 2.0.0

_mshMod_migrateBrokenReminder("checkup_reminder")

0 comments on commit 773e5ff

Please sign in to comment.