diff options
Diffstat (limited to 'engines/xeen/scripts.cpp')
-rw-r--r-- | engines/xeen/scripts.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/engines/xeen/scripts.cpp b/engines/xeen/scripts.cpp index 247165f085..6a08286148 100644 --- a/engines/xeen/scripts.cpp +++ b/engines/xeen/scripts.cpp @@ -452,8 +452,20 @@ void Scripts::cmdConfirmWord(Common::Array<byte> ¶ms) { } void Scripts::cmdDamage(Common::Array<byte> ¶ms) { error("TODO"); } -void Scripts::cmdJumpRnd(Common::Array<byte> ¶ms) { error("TODO"); } -void Scripts::cmdAfterEvent(Common::Array<byte> ¶ms) { error("TODO"); } + +/** + * Jump if a random number matches a given value + */ +void Scripts::cmdJumpRnd(Common::Array<byte> ¶ms) { + int v = _vm->getRandomNumber(1, params[0]); + if (v == params[1]) + _lineNum = params[2] - 1; + + _var4F = true; + cmdNoAction(params); +} + +void Scripts::cmdAlterEvent(Common::Array<byte> ¶ms) { error("TODO"); } /** * Stores the current location and line for later resuming, and set up to execute |