I’m looking to hunt down line breaks in Low-Key Learny Jokey Journey, and it occurs to me that it happens in the other similar games I have e.g. Very Vile Fairy File. There’s one big core function, called the verb-checker rule, which is present in all 5 games and slightly different across them.
For instance, one file has this:
this is the verb-checker rule:
(40 lines of code)
(40 lines of code)
Another has this:
this is the verb-checker rule:
(40 lines of code)
if check-rule entry is vc-sad-sunk rule or check-rule entry is vc-bad-bunk rule:
say "Whenever you're ready, just type [b][the player's command in upper case][r] to move on.";
now think-cue entry is true;
the rule succeeds;
(40 lines of code)
The gist is, they are long, 80-line functions that I don’t see any way to break up, and there are 2 or 3 game-specific if-statements I don’t believe I can remove.
So my question is: what is the best way to work around this? I want to fix the line break bugs once and only once, if possible. My current solution is to have, in most games,
to decide whether a rule (called r) is dont-score-yet: no;
Then for one game,
to decide whether a rule (called r) is dont-score-yet:
if r is vc-sad-sunk rule or r is vc-bad-bunk rule:
yes;
no;
This isn’t super-elegant, but it works, and it’s easy to maintain, and it will get me to my goal of having only one 80-line function instead of 5 separate ones to change…
Is there a better way to do things, or have I stumbled about as best I could?
Thanks!