From ef4764b322d94e0931ddd7fdf8c7c12c1b0acef3 Mon Sep 17 00:00:00 2001 From: san7890 Date: Sun, 7 May 2023 00:44:59 +0000 Subject: [PATCH 1/5] `get_ending` to not be numerically based, but instead enum-based. (#219) Co-authored-by: san7890 Reviewed-on: https://git.cavemanon.xyz/Cavemanon/SnootGame/pulls/219 Co-authored-by: san7890 Co-committed-by: san7890 --- .../11.school-assignment-and-route-lock.rpy | 144 +++++++++--------- game/src/credits.rpy | 9 +- game/storyline.rpy | 8 +- game/utility.rpy | 18 ++- 4 files changed, 96 insertions(+), 83 deletions(-) diff --git a/game/script/11.school-assignment-and-route-lock.rpy b/game/script/11.school-assignment-and-route-lock.rpy index e4adf84..e938eff 100644 --- a/game/script/11.school-assignment-and-route-lock.rpy +++ b/game/script/11.school-assignment-and-route-lock.rpy @@ -449,7 +449,7 @@ label chapter_11: # Doomer ending skips this segment call get_ending from _call_get_ending - if _return == 2: + if _return == Endings.Doomer: stop music fadeout 3 pause 2 jump lPromAnnouncement @@ -586,12 +586,12 @@ label chapter_11: pause .5 call get_ending from _call_get_ending_1 - if _return == 4: - jump lSortingThings # Golden - elif _return == 3: - jump lMendingThings # Tradwife + if _return == Endings.Golden: + jump lSortingThings + elif _return == Endings.Tradwife: + jump lMendingThings else: - jump lBreakingThings # Shooter + jump lBreakingThings # All else fails, go to shooter. label lSortingThings: @@ -5212,7 +5212,7 @@ label chapter_11: pause .5 call get_ending from _call_get_ending_2 - if _return == 3: #tradwife + if _return == Endings.Tradwife: "Things are going pretty well. When we discount Trish’s weekly attempt to talk with Fang." @@ -5467,99 +5467,101 @@ label chapter_11: "{cps=*.1}...{/cps}" call get_ending from _call_get_ending_3 - if _return != 1: # any route except Shooter - # duplicated segment from 11B, 11C and 11D transplanted here - window hide - window auto - pause .5 + if _return == Endings.Shooter: + return + + # the following segment makes sense in the context of 11B+11C+11D + window hide + window auto + pause .5 - play music "audio/OST/Appreciating her Company.ogg" fadein 1.0 - pause .5 + play music "audio/OST/Appreciating her Company.ogg" fadein 1.0 + pause .5 - "About fifteen minutes into the assignment, the two of us are just about done." + "About fifteen minutes into the assignment, the two of us are just about done." - "We’re making surprisingly good time." + "We’re making surprisingly good time." - show fang considering with Dissolve(.25) - F "Uhm{cps=*.1}...{/cps} and you said that the electrons hold the negative charge, right?" + show fang considering with Dissolve(.25) + F "Uhm{cps=*.1}...{/cps} and you said that the electrons hold the negative charge, right?" - A "Yeah, yeah." + A "Yeah, yeah." - show fang unimpressed with Dissolve(.25) - F "Can’t imagine when I’d be using this crap in real life." + show fang unimpressed with Dissolve(.25) + F "Can’t imagine when I’d be using this crap in real life." - A "You never know, you might shrink one day." + A "You never know, you might shrink one day." - show fang happy with Dissolve(.25) - F "Yeah, and you might stop pretending you’re livestreaming on Yousnoot." - pause .5 + show fang happy with Dissolve(.25) + F "Yeah, and you might stop pretending you’re livestreaming on Yousnoot." + pause .5 - A "As far as you know I might be giving you incorrect answers, you know." + A "As far as you know I might be giving you incorrect answers, you know." - F "Mhm, sure." - pause .5 + F "Mhm, sure." + pause .5 - "The teacher is making his rounds checking on the students and gets to our desks." - window hide - window auto + "The teacher is making his rounds checking on the students and gets to our desks." + window hide + window auto - show farnsworth: - yalign 0.1 xalign 1.6 - show farnsworth: - easein_cubic 1 xalign 1.2 - with dissolve - pause .5 + show farnsworth: + yalign 0.1 xalign 1.6 + show farnsworth: + easein_cubic 1 xalign 1.2 + with dissolve + pause .5 - Drf "Hello, Anon. Fang." + Drf "Hello, Anon. Fang." - Drf "Are you two getting along well?" + Drf "Are you two getting along well?" - AnonAndFang "Yes, Doctor Fernsworth." + AnonAndFang "Yes, Doctor Fernsworth." - Drf "Great to hear." - pause .5 + Drf "Great to hear." + pause .5 - Drf "You know, I’m real proud of you two." - pause .5 + Drf "You know, I’m real proud of you two." + pause .5 - Drf "I remember at the start of the year you were at each other's throats." + Drf "I remember at the start of the year you were at each other's throats." - Drf "And now look at you!" - pause .5 + Drf "And now look at you!" + pause .5 - show anon concerned - show fang sad - with dissolve - "The two of us cringe." - pause .5 + show anon concerned + show fang sad + with dissolve + "The two of us cringe." + pause .5 - A "Uhh{cps=*.1}...{/cps} Yeah, thanks." + A "Uhh{cps=*.1}...{/cps} Yeah, thanks." - Drf "At any rate, you two understand the material, right?" + Drf "At any rate, you two understand the material, right?" - show anon happy - show fang neutral - with dissolve - A "Oh yeah, Fang and I are fine." + show anon happy + show fang neutral + with dissolve + A "Oh yeah, Fang and I are fine." - show anon neutral with Dissolve(.25) - A "I was just helping them with a few problems." - pause .5 + show anon neutral with Dissolve(.25) + A "I was just helping them with a few problems." + pause .5 - "Phew, remembered it this time." + "Phew, remembered it this time." - Drf "Good, good." + Drf "Good, good." - Drf "I won’t keep you any longer then." + Drf "I won’t keep you any longer then." - show farnsworth: - easeout_cubic 1 xalign 1.6 - pause .5 - hide farnsworth with dissolve + show farnsworth: + easeout_cubic 1 xalign 1.6 + pause .5 + hide farnsworth with dissolve - "Fernsworth meanders to pester the next few students." - pause .5 + "Fernsworth meanders to pester the next few students." + pause .5 - A "Anyways, where were we?" + A "Anyways, where were we?" return diff --git a/game/src/credits.rpy b/game/src/credits.rpy index 5733f40..17d1aa3 100644 --- a/game/src/credits.rpy +++ b/game/src/credits.rpy @@ -218,7 +218,8 @@ image d_credits_text = Composite( label lending: call get_ending from _call_get_ending_4 - if _return == 4: + $ cached_ending = _return # un-necessary to call this so many times + if cached_ending == Endings.Golden: pause 0.5 show snootgame_big with dissolve: # Renpy not allowing you to grab images from the gui folder is serious bullshit subpixel True @@ -248,7 +249,7 @@ label lending: pause 50 queue music 'audio/OST/amberlight brillance live end.ogg' queue music "" loop - elif _return == 3: + elif cached_ending == Endings.Tradwife: play music "audio/OST/Dino Destiny Reader.ogg" pause 0.5 show c_credits_text: @@ -280,12 +281,12 @@ label lending: stop music fadeout 5 scene black with Dissolve(3) pause 2 - if tradwife: + if cached_ending == Endings.Tradwife: scene c10 with Dissolve(1.5) pause 20 scene black with Dissolve(2) pause 1 - elif anonscore >= 4 and fangscore >= 4: + elif cached_ending == Endings.Golden: scene golden ending with Dissolve(1.5) pause 20 scene black with Dissolve(2) diff --git a/game/storyline.rpy b/game/storyline.rpy index 40907a8..d07a240 100644 --- a/game/storyline.rpy +++ b/game/storyline.rpy @@ -23,26 +23,26 @@ label storyline: call chapter_10 from _call_chapter_10 call chapter_11 from _call_chapter_11 call get_ending from _call_get_ending_5 - if _return == 4: + if _return == Endings.Golden: call chapter_11D from _call_chapter_11D call chapter_12D from _call_chapter_12D call chapter_12_5D from _call_chapter_12_5D call chapter_13D from _call_chapter_13D call chapter_14D from _call_chapter_14D - elif _return == 3: + elif _return == Endings.Tradwife: $ tradwife = True call chapter_11C from _call_chapter_11C call chapter_12C from _call_chapter_12C call chapter_12_5C from _call_chapter_12_5C call chapter_13C from _call_chapter_13C call chapter_14C from _call_chapter_14C - elif _return == 2: + elif _return == Endings.Doomer: call chapter_11B from _call_chapter_11B call chapter_12B from _call_chapter_12B # no chapter_13 here since the scene is different enough to the other routes for everything to go into 13C call chapter_13B from _call_chapter_13B call chapter_14B from _call_chapter_14B - else: + else: # if all else fails, we just assume that we got Endings.Shooter call chapter_11A from _call_chapter_11A call chapter_12A from _call_chapter_12A call chapter_12_5D from _call_chapter_12_5D_1 diff --git a/game/utility.rpy b/game/utility.rpy index c0fdcae..9f5bd61 100644 --- a/game/utility.rpy +++ b/game/utility.rpy @@ -1,5 +1,15 @@ ## Utility functions for game setup, debugging etc. +init python: + from enum import Enum + + # Create compile-time macros to more easily track what ending goes to what without the need for magic numbers or strings that can be mistyped + class Endings(Enum): + Shooter = 0 + Doomer = 1 + Tradwife = 2 + Golden = 3 + label initstats(anon=0, fang=0, trad=False): # Sets various game-related global variables # :param int anon: Anon's score @@ -14,10 +24,10 @@ label get_ending: # To check what ending we're getting, call this label and then check the value of _return # Sensible to have this logic defined in only one place for consistency if anonscore >= 4 and fangscore >= 4 and wingStory: - return(4) # Golden + return(Endings.Golden) elif anonscore >= 3 and fangscore <=4: - return(3) # Tradwife + return(Endings.Tradwife) elif anonscore <= 3 and fangscore >=3: - return(2) # Doomer + return(Endings.Doomer) else: - return(1) # Shooter + return(Endings.Shooter) From 340528ee022e62532816df79b109a9bdf03393c0 Mon Sep 17 00:00:00 2001 From: san7890 Date: Sat, 6 May 2023 20:06:38 -0600 Subject: [PATCH 2/5] removes the ending flag --- game/script.rpy | 1 - game/storyline.rpy | 1 - game/utility.rpy | 2 -- 3 files changed, 4 deletions(-) diff --git a/game/script.rpy b/game/script.rpy index 2e85614..3859f89 100644 --- a/game/script.rpy +++ b/game/script.rpy @@ -316,7 +316,6 @@ transform scloserleft: label start: $ fangscore = 0 $ anonscore = 0 - $ tradwife = False $ wingStory = False pause 1.0 call storyline from _call_storyline diff --git a/game/storyline.rpy b/game/storyline.rpy index d07a240..5822476 100644 --- a/game/storyline.rpy +++ b/game/storyline.rpy @@ -30,7 +30,6 @@ label storyline: call chapter_13D from _call_chapter_13D call chapter_14D from _call_chapter_14D elif _return == Endings.Tradwife: - $ tradwife = True call chapter_11C from _call_chapter_11C call chapter_12C from _call_chapter_12C call chapter_12_5C from _call_chapter_12_5C diff --git a/game/utility.rpy b/game/utility.rpy index 9f5bd61..241cdd5 100644 --- a/game/utility.rpy +++ b/game/utility.rpy @@ -14,10 +14,8 @@ label initstats(anon=0, fang=0, trad=False): # Sets various game-related global variables # :param int anon: Anon's score # :param int fang: Fang's score - # :param bool trad: Tradwife ending flag $ anonscore = anon $ fangscore = fang - $ tradwife = trad return label get_ending: From 404d3f91bd534fafb31fd0a19f58a3794bff1de7 Mon Sep 17 00:00:00 2001 From: san7890 Date: Sat, 6 May 2023 20:11:35 -0600 Subject: [PATCH 3/5] removes the `trad` arg to `initstats()` as well --- game/utility.rpy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/game/utility.rpy b/game/utility.rpy index 241cdd5..af7b95e 100644 --- a/game/utility.rpy +++ b/game/utility.rpy @@ -10,7 +10,7 @@ init python: Tradwife = 2 Golden = 3 -label initstats(anon=0, fang=0, trad=False): +label initstats(anon=0, fang=0): # Sets various game-related global variables # :param int anon: Anon's score # :param int fang: Fang's score From 93a548957d95680055c9b6a42c70c1b357fd16c3 Mon Sep 17 00:00:00 2001 From: san7890 Date: Sat, 6 May 2023 23:48:40 -0600 Subject: [PATCH 4/5] fix: Cleans up TODO regarding duplicate Rosa line. Also includes shoddy Spanish translation, definitely requires proofreading. --- .../5.fang-and-anon-cut-class-to-talk-on-the-roof.rpy | 3 +-- .../5.fang-and-anon-cut-class-to-talk-on-the-roof.rpy | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/game/script/5.fang-and-anon-cut-class-to-talk-on-the-roof.rpy b/game/script/5.fang-and-anon-cut-class-to-talk-on-the-roof.rpy index b9c1835..ae29908 100644 --- a/game/script/5.fang-and-anon-cut-class-to-talk-on-the-roof.rpy +++ b/game/script/5.fang-and-anon-cut-class-to-talk-on-the-roof.rpy @@ -844,7 +844,7 @@ label chapter_5: show fang considering flip with Dissolve(.25) - Ro "I just{cps=*.1}...{/cps}{w=.3} URGH!{w=.4} Do you have {i}any{/i} idea how long it takes for those to bloom!" + Ro "I just{cps=*.1}...{/cps}{w=.3} URGH!{w=.4} Do you have {i}any{/i} idea how hard those are to get!" Ro "Name!{w=.4} What is your name?!" @@ -1388,7 +1388,6 @@ label chapter_5: A "Err{cps=*.1}...{/cps}{w=.3} Sorry?" - # TODO: the line "do you have any idea how long it takes for those to bloom" is also used earlier when Anon first falls into the flowerbed Ro "{i}Ay Dios mío{/i}{cps=*.1}...{/cps} do you have any idea how long it takes those to bloom?!" if not punched_into_flowerbed: diff --git a/game/tl/es/script/5.fang-and-anon-cut-class-to-talk-on-the-roof.rpy b/game/tl/es/script/5.fang-and-anon-cut-class-to-talk-on-the-roof.rpy index 9941414..de2ed9c 100644 --- a/game/tl/es/script/5.fang-and-anon-cut-class-to-talk-on-the-roof.rpy +++ b/game/tl/es/script/5.fang-and-anon-cut-class-to-talk-on-the-roof.rpy @@ -1,4 +1,4 @@ -# TODO: Translation updated at 2022-10-24 02:07 +# TODO: Translation updated at 2023-05-06 05:43 UTC # game/script/5.fang-and-anon-cut-class-to-talk-on-the-roof.rpy:20 translate es chapter_5_ad464e5e: @@ -1119,8 +1119,8 @@ translate es movie_4263d346: # game/script/5.fang-and-anon-cut-class-to-talk-on-the-roof.rpy:847 translate es movie_98d69c6e: - # Ro "I just{cps=*.1}...{/cps}{w=.3} URGH!{w=.4} Do you have {i}any{/i} idea how long it takes for those to bloom!" - Ro "Solo{cps=*.1}...{/cps}{w=.3} ¡URGH!{w=.4} ¿Tienes {i}alguna{/i} idea de cuánto tardan en florecer?" + # Ro "I just{cps=*.1}...{/cps}{w=.3} URGH!{w=.4} Do you have {i}any{/i} idea how hard those are to get!" + Ro "Solo{cps=*.1}...{/cps}{w=.3} ¡URGH!{w=.4} ¿Tienes {i}alguna{/i} idea de lo dificil que son para conseguierlos?" # game/script/5.fang-and-anon-cut-class-to-talk-on-the-roof.rpy:849 translate es movie_2fab4cce: From 279608bf8073e277469b194287bcb1e8acf52c3d Mon Sep 17 00:00:00 2001 From: san7890 Date: Sun, 7 May 2023 00:25:04 -0600 Subject: [PATCH 5/5] actually uses the automated renpy translation feature formatting didn't use the automated renpy feature so this wasn't correct whoops --- ...ng-and-anon-cut-class-to-talk-on-the-roof.rpy | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/game/tl/es/script/5.fang-and-anon-cut-class-to-talk-on-the-roof.rpy b/game/tl/es/script/5.fang-and-anon-cut-class-to-talk-on-the-roof.rpy index de2ed9c..e732558 100644 --- a/game/tl/es/script/5.fang-and-anon-cut-class-to-talk-on-the-roof.rpy +++ b/game/tl/es/script/5.fang-and-anon-cut-class-to-talk-on-the-roof.rpy @@ -1,4 +1,4 @@ -# TODO: Translation updated at 2023-05-06 05:43 UTC +# TODO: Translation updated at 2022-10-24 02:07 # game/script/5.fang-and-anon-cut-class-to-talk-on-the-roof.rpy:20 translate es chapter_5_ad464e5e: @@ -1116,12 +1116,6 @@ translate es movie_4263d346: # "I shrug apologetically." "Me encojo de hombros a modo de disculpa." -# game/script/5.fang-and-anon-cut-class-to-talk-on-the-roof.rpy:847 -translate es movie_98d69c6e: - - # Ro "I just{cps=*.1}...{/cps}{w=.3} URGH!{w=.4} Do you have {i}any{/i} idea how hard those are to get!" - Ro "Solo{cps=*.1}...{/cps}{w=.3} ¡URGH!{w=.4} ¿Tienes {i}alguna{/i} idea de lo dificil que son para conseguierlos?" - # game/script/5.fang-and-anon-cut-class-to-talk-on-the-roof.rpy:849 translate es movie_2fab4cce: @@ -6944,3 +6938,11 @@ translate es strings: old "Interrupt" new "Interrumpir" +# TODO: Translation updated at 2023-05-07 00:26 + +# game/script/5.fang-and-anon-cut-class-to-talk-on-the-roof.rpy:847 +translate es movie_f9188bac: + + # Ro "I just{cps=*.1}...{/cps}{w=.3} URGH!{w=.4} Do you have {i}any{/i} idea how hard those are to get!" + Ro "Solo{cps=*.1}...{/cps}{w=.3} ¡URGH!{w=.4} ¿Tienes {i}alguna{/i} idea de lo dificil que son para conseguierlos?" +