In
Codename Iceman, there's this minigame wherein your opponent doesn't let you save your way to victory. I thought I'd do a little investigation into how this is done, and it turns out to be pretty simple. Here's how:
- In Game::replay, right after the (send gSounds:pause(0)) line near the bottom of that method, add (gRegions eachElementDo: #replay).
- In Game::rgn, add a blank replay method. Just (method (replay)).
- In your protected room (or region!), add a non-blank replay method. This'll trigger whenever the player restores a saved game that's set in this room.
For completeness' sake, here's basically the replay method from
Iceman room 39:
(method (replay)
(if (< 2 (++ replays))
(TextPrint {The old salt looks you in the eye and says, \n\"Now lad I won't be playin' with \nye restorin' every time you lose. \nThat be cheatin'!\"})
; Screw over the player here or whatever.
else
(switch replays
(1
(TextPrint {The old salt says, \"well do ye think your little rest has changed your luck?\"})
)
(2
(TextPrint {\"You wouldn't be saving the game just to avoid losing would ye?\"})
)
)
)
)
Relatedly, sites like TVTropes report that the old salt'll remove your save game when you restore too often. I cannot in fact find anything in the actual decompilation to this effect -- only that the rum is gone.