From 70ec01da8b7921225876b7a1c04575f3f00104dc Mon Sep 17 00:00:00 2001 From: LoafyLemon Date: Tue, 29 Oct 2024 14:06:38 +0000 Subject: [PATCH] Wardrobe 2.0 - Easter egg, text tags --- .../characters/astoria/wardrobe_reactions.rpy | 2 +- .../characters/cho/wardrobe_reactions.rpy | 4 +- .../hermione/wardrobe_reactions.rpy | 2 +- .../characters/luna/wardrobe_reactions.rpy | 2 +- .../characters/susan/wardrobe_reactions.rpy | 7 +-- .../characters/tonks/wardrobe_reactions.rpy | 2 +- game/scripts/gui/say.rpy | 8 +++ game/scripts/interface/screens.rpy | 7 ++- game/scripts/utility/text_tags.rpy | 27 +++++++++ game/scripts/wardrobe/functions.rpy | 33 +++++++++-- game/scripts/wardrobe/wardrobe.rpy | 59 ++++++++++++++++++- 11 files changed, 134 insertions(+), 19 deletions(-) diff --git a/game/scripts/characters/astoria/wardrobe_reactions.rpy b/game/scripts/characters/astoria/wardrobe_reactions.rpy index 65ac8d92..f29451e4 100644 --- a/game/scripts/characters/astoria/wardrobe_reactions.rpy +++ b/game/scripts/characters/astoria/wardrobe_reactions.rpy @@ -55,7 +55,7 @@ label ast_reaction_touch(what): gen "*Err*..." ("base", xpos="far_left", ypos="head") ast "When people called you eccentric I didn't think they meant bonkers mad..." ("clench", "closed", "base", "down") elif what == "breasts": - $ mouse_heart() + $ mouse_boing() random: block: diff --git a/game/scripts/characters/cho/wardrobe_reactions.rpy b/game/scripts/characters/cho/wardrobe_reactions.rpy index e1f425be..3ab2b4a0 100644 --- a/game/scripts/characters/cho/wardrobe_reactions.rpy +++ b/game/scripts/characters/cho/wardrobe_reactions.rpy @@ -89,8 +89,8 @@ label cho_reaction_touch(what): elif what == "breasts": - $ mouse_heart() - + $ mouse_boing() + if states.cho.level < 16: # Before Gryffindor match random: cho @ cheeks blush "Kissing them for good luck are we?" ("smile", "narrow", "base", "mid") diff --git a/game/scripts/characters/hermione/wardrobe_reactions.rpy b/game/scripts/characters/hermione/wardrobe_reactions.rpy index 7c538568..eb70213c 100644 --- a/game/scripts/characters/hermione/wardrobe_reactions.rpy +++ b/game/scripts/characters/hermione/wardrobe_reactions.rpy @@ -90,7 +90,7 @@ label her_reaction_touch(what): her "Why are you doing that?" ("clench", "base", "base", "R") elif what == "breasts": - $ mouse_heart() + $ mouse_boing() if states.her.level >= 20: random: diff --git a/game/scripts/characters/luna/wardrobe_reactions.rpy b/game/scripts/characters/luna/wardrobe_reactions.rpy index bd3f2c91..71cdd171 100644 --- a/game/scripts/characters/luna/wardrobe_reactions.rpy +++ b/game/scripts/characters/luna/wardrobe_reactions.rpy @@ -102,7 +102,7 @@ label lun_reaction_touch(what): elif what == "breasts": - $ mouse_heart() + $ mouse_boing() if states.lun.tier == 5: random: diff --git a/game/scripts/characters/susan/wardrobe_reactions.rpy b/game/scripts/characters/susan/wardrobe_reactions.rpy index d8f93912..01e8ba18 100644 --- a/game/scripts/characters/susan/wardrobe_reactions.rpy +++ b/game/scripts/characters/susan/wardrobe_reactions.rpy @@ -37,11 +37,6 @@ label sus_reaction_category_fail(category): return label sus_reaction_touch(what): - if what == "head": - $ mouse_headpat() - else: - $ mouse_heart() - if what == "head": $ mouse_headpat() @@ -51,7 +46,7 @@ label sus_reaction_touch(what): sus @ cheeks blush "Professor, p--{w=0.2} please..." ("base", "base", "sad", "downR") elif what == "breasts": - $ mouse_heart() + $ mouse_boing() random: sus @ cheeks blush "W--{w=0.2} Why are you..." ("soft", "happy", "sad", "stare") diff --git a/game/scripts/characters/tonks/wardrobe_reactions.rpy b/game/scripts/characters/tonks/wardrobe_reactions.rpy index af4da862..c96872c8 100644 --- a/game/scripts/characters/tonks/wardrobe_reactions.rpy +++ b/game/scripts/characters/tonks/wardrobe_reactions.rpy @@ -66,7 +66,7 @@ label ton_reaction_touch(what): ton "Don't you dare touch my elbows next..." ("soft", "narrow", "base", "mid") elif what == "breasts": - $ mouse_heart() + $ mouse_boing() random: ton "*Mmm*..." ("base", "narrow", "base", "up") diff --git a/game/scripts/gui/say.rpy b/game/scripts/gui/say.rpy index 6b44e156..ec607fa9 100644 --- a/game/scripts/gui/say.rpy +++ b/game/scripts/gui/say.rpy @@ -151,6 +151,14 @@ style what_centered: hinting "bytecode" size 48 +style what_centered_small: + align (0.5, 0.5) + text_align 0.5 + color "#fff" + outlines [(2, "#000000", 1, 1)] + hinting "bytecode" + size 24 + style namebox: ysize 22 # Halved due to oversampling padding (32, 0, 32, 0) diff --git a/game/scripts/interface/screens.rpy b/game/scripts/interface/screens.rpy index dc8d6b73..a073a08b 100644 --- a/game/scripts/interface/screens.rpy +++ b/game/scripts/interface/screens.rpy @@ -64,10 +64,11 @@ screen close_button_background(action=Return("Close"), keysym=None): # Animation effect controller screen gfx_effect(start_x=None, start_y=None, target_x=None, target_y=None, img=None, xanchor=0.5, yanchor=0.5, zoom=0.5, duration=1.0, timer=0.5): tag gfx + layer "interface" zorder 30 if target_x: - add img xanchor xanchor yanchor yanchor zoom zoom at move_to(start_x, start_y, target_x, target_y, duration) + add img xanchor xanchor yanchor yanchor zoom zoom at move_to(start_x, start_y, target_x, target_y, duration), gfx_effect_hide(timer) else: add img xanchor xanchor yanchor yanchor zoom zoom xpos start_x ypos start_y timer timer action Hide("gfx_effect") @@ -75,3 +76,7 @@ screen gfx_effect(start_x=None, start_y=None, target_x=None, target_y=None, img= screen ctc(): zorder 30 add "ctc" + +transform gfx_effect_hide(timer): + alpha 1 + linear timer alpha 0 diff --git a/game/scripts/utility/text_tags.rpy b/game/scripts/utility/text_tags.rpy index 48645b09..6aaf2ea1 100644 --- a/game/scripts/utility/text_tags.rpy +++ b/game/scripts/utility/text_tags.rpy @@ -125,6 +125,21 @@ init python: rv.append((kind, text)) return rv + @renpy.pure + def text_tag_squeeze(tag, argument, contents): + if not settings.get("kinetictext"): + return contents + + rv = [] + kwargs = convert_tags_to_kwargs(contents) + for kind, text in contents: + if kind == renpy.TEXT_TEXT: + d = At(Text(text, **kwargs), squeeze_text) + rv.append((renpy.TEXT_DISPLAYABLE, d)) + else: + rv.append((kind, text)) + return rv + @renpy.pure def text_tag_shudder(tag, argument, contents): if not settings.get("kinetictext"): @@ -225,6 +240,17 @@ transform pulse_text: easein 0.25 yzoom 1.0 repeat +transform squeeze_text: + animation + subpixel True + perspective True + xzoom 1.0 + pos (-240, 2) + easeout 0.5 xzoom 0.5# pos (-300, 2) + easeout 0.5 xzoom 1.0# pos (-240, 2) + pause 1 + repeat + transform shake_text: animation subpixel True @@ -299,6 +325,7 @@ define config.custom_text_tags = { "shake": text_tag_shake, "shudder": text_tag_shudder, "pulse": text_tag_pulse, + "squeeze": text_tag_squeeze, "flip": text_tag_flip, "rotate": text_tag_rotate, } diff --git a/game/scripts/wardrobe/functions.rpy b/game/scripts/wardrobe/functions.rpy index 5285d730..99b7f92f 100644 --- a/game/scripts/wardrobe/functions.rpy +++ b/game/scripts/wardrobe/functions.rpy @@ -118,20 +118,33 @@ init -1 python: def mouse_headpat(): """Causes the mouse to be moved away from current position and displays a heart effect""" - renpy.play('sounds/slap_03.ogg') + renpy.play("sounds/slap_03.ogg") renpy.stop_predict_screen("gfx_effect") x, y = renpy.get_mouse_pos() xx, yy = x, y-15 - img = At(Text("*pat*", size=16, color="#000000CC", outlines=[(1, "#FFFFFFCC", 0, 0)]), random_rotation) + img = At(Text(_("{shudder}*pat*{/shudder}")), random_rotation) renpy.hide_screen("gfx_effect") - renpy.show_screen("gfx_effect", start_x=x, start_y=y, target_x=xx, target_y=yy, img=img, xanchor=0.5, yanchor=0.65, zoom=1.0, timer=0.35) + renpy.show_screen("gfx_effect", start_x=x, start_y=y, target_x=xx, target_y=yy, img=img, xanchor=0.5, yanchor=0.65, zoom=1.0, timer=1) + + def mouse_boing(): + """Causes the mouse to be moved away from current position and displays a heart effect""" + renpy.play('sounds/boing02.ogg') + renpy.stop_predict_screen("gfx_effect") + x, y = renpy.get_mouse_pos() + xx, yy = x, y-15 + img = At(Text(_("{shake}*boing*{/shake}")), random_rotation) + renpy.hide_screen("gfx_effect") + renpy.show_screen("gfx_effect", start_x=x, start_y=y, target_x=xx, target_y=yy, img=img, xanchor=0.5, yanchor=0.65, zoom=1.0, timer=1) def mouse_heart(): """Causes the mouse to be moved away from current position and displays a heart effect""" - renpy.play('sounds/kiss.ogg') + renpy.play('sounds/drooling.ogg') renpy.stop_predict_screen("gfx_effect") x, y = renpy.get_mouse_pos() - renpy.show_screen("gfx_effect", start_x=x, start_y=y, target_x=x, target_y=y, img="love_heart", xanchor=0.45, yanchor=0.65, zoom=0.2, timer=0.45) + xx, yy = x, y-15 + img = At(At(Text(_("*squelch*"), style="what_centered_small"), squeeze_hearts), random_rotation) + renpy.hide_screen("gfx_effect") + renpy.show_screen("gfx_effect", start_x=x, start_y=y, target_x=xx, target_y=yy, img=img, xanchor=0.5, yanchor=0.65, zoom=1.0, timer=1) def wardrobe_fail_hint(value): """Displays required whoring/friendship/affection level.""" @@ -171,3 +184,13 @@ init -1 python: files.append(build_button(rp)) return files + +transform squeeze_hearts: + animation + subpixel True + transform_anchor True + xzoom 1.0 + easein 0.5 xzoom 0.65 + easeout 0.5 xzoom 1.0 + pause 1 + repeat diff --git a/game/scripts/wardrobe/wardrobe.rpy b/game/scripts/wardrobe/wardrobe.rpy index 28ecb4ae..ef1544b5 100644 --- a/game/scripts/wardrobe/wardrobe.rpy +++ b/game/scripts/wardrobe/wardrobe.rpy @@ -21,6 +21,7 @@ default wardrobe.allow_opacity = False # Functions init python in wardrobe: + import functools from collections import OrderedDict _last_track = None @@ -236,6 +237,54 @@ init python in wardrobe: if character.is_worn(item.type): return renpy.store.AlphaMask(renpy.store.Transform(item.icon, xysize=(48, 48)), renpy.store.Transform("wheelmenu_button_opaque", xysize=(48, 48))) return renpy.store.Transform(renpy.store.AlphaMask(renpy.store.Transform(item.icon, xysize=(48, 48)), renpy.store.Transform("wheelmenu_button_opaque", xysize=(48, 48))), matrixcolor=renpy.store.SaturationMatrix(0)*renpy.store.BrightnessMatrix(-0.25)*renpy.store.OpacityMatrix(0.5)) + + @functools.cache + def easteregg(character_name): + head_action = renpy.store.Function(wardrobe_react,"touch", "head") + breasts_action = renpy.store.Function(wardrobe_react, "touch", "breasts") + vagina_action = renpy.store.Function(wardrobe_react, "touch", "vagina") + + # Positions (hardcoded) + if character_name == "tonks": + head_box = (763, 31, 882, 160) + breasts_box = (735, 232, 890, 310) + vagina_box = (765, 405, 834, 466) + elif character_name == "hermione": + head_box = (760, 14, 882, 170) + breasts_box = (735, 232, 880, 320) + vagina_box = (770, 387, 834, 440) + elif character_name == "cho": + head_box = (756, 71, 863, 193) + breasts_box = (751, 247, 856, 318) + vagina_box = (768, 405, 826, 457) + elif character_name == "luna": + head_box = (763, 31, 885, 165) + breasts_box = (740, 220, 872, 310) + vagina_box = (771, 391, 834, 444) + elif character_name == "astoria": + head_box = (757, 64, 863, 194) + breasts_box = (755, 254, 863, 318) + vagina_box = (775, 410, 824, 457) + else: # Susan + fallback + head_box = (771, 56, 871, 184) + breasts_box = (724, 230, 882, 342) + vagina_box = (770, 405, 850, 464) + + head_xysize = (head_box[2] - head_box[0], head_box[3] - head_box[1]) + breasts_xysize = (breasts_box[2] - breasts_box[0], breasts_box[3] - breasts_box[1]) + vagina_xysize = (vagina_box[2] - vagina_box[0], vagina_box[3] - vagina_box[1]) + + head_pos = (head_box[0], head_box[1]) + breasts_pos = (breasts_box[0], breasts_box[1]) + vagina_pos = (vagina_box[0], vagina_box[1]) + + # Buttons + head_btn = renpy.store.Button(child=renpy.store.Null(), style="wardrobe_secret", xysize=head_xysize, action=head_action) + breasts_btn = renpy.store.Button(child=renpy.store.Null(*breasts_xysize), style="wardrobe_secret", xysize=breasts_xysize, action=breasts_action) + vagina_btn = renpy.store.Button(child=renpy.store.Null(*vagina_xysize), style="wardrobe_secret", xysize=vagina_xysize, action=vagina_action) + + return [(head_btn, head_pos), (breasts_btn, breasts_pos), (vagina_btn, vagina_pos)] + # Context label wardrobe(inter_pause=True): $ disable_game_menu() @@ -413,7 +462,7 @@ screen wardrobe(): hbox: xfill True - text _("Value") xalign 0 + text _("Brightness") xalign 0 # HSV calls it value, but brightness is more user friendly frame: xysize (255, 32) xalign 1.0 @@ -487,6 +536,9 @@ screen wardrobe(): textbutton "Strip" action wardrobe.strip textbutton "Return" action wardrobe.exit keysym "K_ESCAPE" + for i, j in wardrobe.easteregg(character.name): + add i pos j + style wardrobe_item_button is empty: background Transform("wheelmenu_button", xysize=(96,96)) hover_background At(Transform("wheelmenu_button_opaque", xysize=(96,96)), wheelmenu_hover_anim) @@ -541,3 +593,8 @@ style wardrobe_checkbox_button: style wardrobe_checkbox_button_text is wardrobe_button_text: first_indent 24 + +# Debug only +style wardrobe_secret: + #background "#ff000025" + background None