Immersive Terminal for RPGs v1.7.0
"Feelin' Lucky? ;)" β a one-shot d20 roll the player can pull right before tackling the decrypt minigame, for a chance at burned attempts or revealed letters. Feature suggested by Pedro Fuster.
β¨ Features
decryptluck roll. When the cipher minigame opens, a small popup sits above the wordle: type a number 1β20, hit Enter, and the d20 decides whether you walk in with an edge or a handicap.- Roll 1 β critical fail. Smiley
;_;with red jitter; 2 attempts burned as β phantom rows at the top of the grid. - Rolls 2β9 β 1 attempt burned.
- Rolls 10β14 β 1 letter of the target word revealed in a hint row above the grid.
- Rolls 15β19 β 2 letters revealed.
- Natural 20 β
\o/with green burst; 3 letters revealed.
- Roll 1 β critical fail. Smiley
- One shot per file, persisted across cancels. Open, roll, press Esc, re-run
decrypton the same file β the popup stays gone AND the roll's effect (burned rows or revealed letters) is restored exactly as you left it. Cancelling without rolling or guessing keeps your shot available for next time. - Skip without using the slot: just start typing your guess in the wordle. Submitting any guess auto-dismisses the popup without burning the luck roll's consequences.
- GM opt-out per file. Add
decryptLuck: falseto a file's front-matter to hide the popup entirely on that file β useful for hard-mode challenges where you don't want a bailout. - Reduced-motion respected. All luck animations (jitter, pulse, burst) are gated by
prefers-reduced-motion. - Bilingual. Full English + Brazilian Portuguese translations for the title, label, result messages, and the "REVEALED" caption.
π§ Under the hood
- New components:
WordleLuckPopup.jsxand integration intoDecryptGame.jsx. - New engine helpers in
engine/wordle.js:rollLuck(n)(pure tier resolver) andpickRevealPositions(len, count, taken, rand)(deterministic with an injectable RNG, so tests pin the picks). DecryptGameacceptsinitialLostByLuckandinitialRevealedprops seeded from Terminal's per-pathluckEffectsmap, so the roll's outcome survives unmount/remount cycles.- 36 new tests covering:
rollLucktier boundaries (including the 15-overlap resolution),pickRevealPositionsselection + pool exhaustion, the luck popup's autofocus / digit-only input / shake-on-invalid / hold-then-commit timing, the integration paths (roll, skip-via-guess, cancel-without-interaction), and the effect-persistence props (restored burned rows + restored hint row from initial state). 209 automated tests total (up from 176); lint + build clean.
π Fix tagging along
- Fallout
directive_06.mdnow hascrackDC: 14βcrackcorrectly opens the roll dialog instead of falling straight through to the brute-force bar. (Audit found this was the only tracked locked file in the project missing its DC.)
Credits
Luck roll idea + spec: Pedro Fuster. Thanks Pedro!