Compare commits

...

2 Commits

Author SHA1 Message Date
LoafyLemon 0a213edac3 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
2024-04-23 19:26:24 +01:00
LoafyLemon 63b1afc817 Say box
* Unify say box
2024-04-23 19:25:17 +01:00
6 changed files with 92 additions and 83 deletions

View File

@ -203,7 +203,6 @@ style say_label is default:
bold False
text_align 0.5
align (0.5, 0.5)
#outlines [(1, settings.get('text_outline'), 1, 0)]
style dark_say_label:
color settings.get('text_color_night')
@ -211,22 +210,19 @@ style dark_say_label:
style light_say_label:
color settings.get('text_color_day')
style say_label_alt is say_dialogue_alt
style say_label is say_dialogue
# Say dialogue
style say_dialogue is default:
outlines [(1, settings.get('text_outline'), 1, 0)]
style dark_say_dialogue:
color settings.get('text_color_night')
style light_say_dialogue:
color settings.get('text_color_day')
style say_dialogue_alt:
style say_dialogue is default:
color "#ffffff"
outlines [(1, "#000000", 1, 0)]
outlines [(2, "#000000", 0, 0)]
style say_thought is say_dialogue
style dark_say_thought is dark_say_dialogue
@ -248,12 +244,6 @@ style light_window is light_gui_frame:
# Say window
style say_window:
ysize 143
padding (250, 40, 250, 0)
top_margin 22
yalign 1.0
style dark_say_window is dark_window:
take say_window
background "interface/frames/gray/frame.webp"
@ -262,8 +252,11 @@ style light_say_window is light_window:
take say_window
background "interface/frames/gold/frame.webp"
style say_window_alt:
take say_window
style say_window:
ysize 143
padding (250, 40, 250, 0)
top_margin 22
yalign 1.0
background "fade_gradient"
# Namebox
@ -283,9 +276,6 @@ style light_namebox is light_gui_frame:
take namebox
# background Transform(Frame("gui/light_namebox.png", 8, 8))
style namebox_alt:
take namebox
# Text
style dark_text:

View File

@ -36,12 +36,12 @@ screen say(who, what, side_image=None, icon=None):
# TODO: While this works, there might be a better way to add effects based on contents of the dialogue.
if text_inner_thought(what) and not renpy.showing("cg"):
if text_inner_thought(what):
add "fade_gradient"
elif renpy.showing("cg"):
add "interface/bld.webp":
if _windows_hidden:
ypos 1000
add "interface/bld.webp":
if _windows_hidden:
ypos 1000
if side_image:
add side_image yalign 1.0 zoom 0.5
@ -49,32 +49,18 @@ screen say(who, what, side_image=None, icon=None):
add SideImage()
window id "window":
if renpy.showing("cg"):
style "say_window_alt"
style "say_window"
if who:
window:
id "namebox"
style "namebox_alt"
text who:
style "say_label_alt"
if who:
window:
id "namebox"
style "namebox"
text who:
style "say_label"
text what:
id "what"
style "say_dialogue_alt"
else:
style gui.theme("say_window")
if who:
window:
id "namebox"
style gui.theme("namebox")
text who:
style gui.theme("say_label")
text what:
id "what"
style gui.theme("say_dialogue")
text what:
id "what"
style "say_dialogue"
if _windows_hidden:
ypos 1000
@ -108,10 +94,7 @@ screen say(who, what, side_image=None, icon=None):
screen quick_menu():
hbox:
if renpy.showing("cg"):
style_prefix "quick_alt"
else:
style_prefix "quick"
style_prefix "quick"
xalign 1.0
yoffset -30
@ -128,24 +111,14 @@ style quick_button is default:
xpadding 8
ypadding 8
style quick_button_text is default:
style quick_button_text:
size 10
idle_color "#8888"
hover_color "#ccc"
selected_idle_color "#cc08"
selected_hover_color "#cc0"
insensitive_color "#4448"
style quick_alt_button is quick_button
style quick_alt_button_text:
take quick_button_text
idle_color "#8888"
hover_color "#fff"
insensitive_color "#4448"
idle_outlines [(1, "#0008", 1, 1)]
hover_outlines [(1, "#000", 1, 1)]
# Choice screen
#
# This screen is used to display the in-game choices presented by the menu

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}")
self._weather = value
moon_cycle = renpy.random.randint(5, 9)
self.moon = (self.day % moon_cycle == 0)
self.moon = (self.day % 7 == 0)
screen gold(old, new):
tag gold

View File

@ -8,7 +8,8 @@ default cupboard_OBJ = RoomObject(
idle="cupboard_idle",
action={
"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"
)

View File

@ -315,8 +315,11 @@ label paperwork:
call paperwork_progress_chapter
if not game.daytime and game.moon:
call paperwork_full_moon
if not game.daytime and (game.day % 7 == 0):
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")
@ -335,8 +338,8 @@ label paperwork_report_check:
return
label paperwork_progress_chapter(message = ""):
$ states.paperwork_chapters += 1
label paperwork_progress_chapter(message="", bonus=1):
$ states.paperwork_chapters += bonus
call notes
if states.paperwork_chapters == 1:
@ -347,18 +350,6 @@ label paperwork_progress_chapter(message = ""):
call paperwork_report_check
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):
add img xpos xx ypos yy
zorder 3