Calendar + Paperwork + Moon phases

* Added simple calendar
* Added half-moon phase (Artwork pending)
* Made moon phases cyclical rather than random
* Refactored paperwork and moon bonuses
This commit is contained in:
LoafyLemon 2024-04-23 19:26:24 +01:00
parent 63b1afc817
commit 0a213edac3
4 changed files with 66 additions and 20 deletions

View File

@ -0,0 +1,56 @@
init python:
class Calendar(object):
def __init__(self):
pass
def get(self, span=35):
contents = {i: "" for i in range(span)}
# Add moon cycles
for i in range(span):
if (i % 7 == 0):
contents[i] += "🌕"
elif (i % 7 == 3):
contents[i] += "🌓"
# elif (game.day % 60 == 30) # Blood moon
# Add letters
letters = mailbox.get_letters(True)
for i in letters:
contents[game.day+i.wait] += "✉️"
# Add parcels
parcels = mailbox.get_parcels(True)
for i in parcels:
contents[game.day+i.wait] += "📦"
return contents
default calendar = Calendar()
label calendar:
call screen calendar
jump main_room_menu
screen calendar:
default contents = calendar.get().items()
grid 7 5:
style "empty"
align (0.5, 0.5)
for i, ev in contents:
fixed:
xysize (64, 64)
if i > 29:
add "#888888"
elif i == game.day:
add "#ff0000ff"
else:
add "#fff"
hbox:
text "[(i % 30) + 1]" size 10 color "#000"
text "[ev]" size 24
textbutton "Close" action Return() align (0.5, 0.9)

View File

@ -65,9 +65,7 @@ init -100 python:
raise ValueError(f"Unsupported weather type: {value!r}") raise ValueError(f"Unsupported weather type: {value!r}")
self._weather = value self._weather = value
self.moon = (self.day % 7 == 0)
moon_cycle = renpy.random.randint(5, 9)
self.moon = (self.day % moon_cycle == 0)
screen gold(old, new): screen gold(old, new):
tag gold tag gold

View File

@ -8,7 +8,8 @@ default cupboard_OBJ = RoomObject(
idle="cupboard_idle", idle="cupboard_idle",
action={ action={
"Open Inventory": (Text("🎒", align=(0.5, 0.5)), Jump("inventory"), "True"), "Open Inventory": (Text("🎒", align=(0.5, 0.5)), Jump("inventory"), "True"),
"Rummage": (Text("🖐️", align=(0.5, 0.5)), Jump("cupboard"), "True") "Rummage": (Text("🖐️", align=(0.5, 0.5)), Jump("cupboard"), "True"),
"Calendar": (Text("📆", align=(0.5, 0.5)), Jump("calendar"), "True"),
}, },
tooltip="Cupboard" tooltip="Cupboard"
) )

View File

@ -315,8 +315,11 @@ label paperwork:
call paperwork_progress_chapter call paperwork_progress_chapter
if not game.daytime and game.moon: if not game.daytime and (game.day % 7 == 0):
call paperwork_full_moon call paperwork_progress_chapter("The Full moon makes you feel vastly more productive.\n", bonus=2)
if not game.daytime and (game.day % 7 == 3):
call paperwork_progress_chapter("The half moon makes you feel more productive.\n")
call gen_chibi("sit_behind_desk") call gen_chibi("sit_behind_desk")
@ -335,8 +338,8 @@ label paperwork_report_check:
return return
label paperwork_progress_chapter(message = ""): label paperwork_progress_chapter(message="", bonus=1):
$ states.paperwork_chapters += 1 $ states.paperwork_chapters += bonus
call notes call notes
if states.paperwork_chapters == 1: if states.paperwork_chapters == 1:
@ -347,18 +350,6 @@ label paperwork_progress_chapter(message = ""):
call paperwork_report_check call paperwork_report_check
return return
label paperwork_full_moon:
call paperwork_progress_chapter("The Full moon makes you feel more productive.\n")
return
label paperwork_concentration:
call paperwork_progress_chapter("You maintain perfect concentration during your work and finish another chapter of the report.\n")
return
label paperwork_speedwriting:
call paperwork_progress_chapter("You use your Speedwriting skills and finish another chapter of the report.\n")
return
screen gui_tooltip(img=None, xx=335, yy=210): screen gui_tooltip(img=None, xx=335, yy=210):
add img xpos xx ypos yy add img xpos xx ypos yy
zorder 3 zorder 3