diff options
| author | Travis Howell | 2006-04-21 07:42:40 +0000 |
|---|---|---|
| committer | Travis Howell | 2006-04-21 07:42:40 +0000 |
| commit | 9bcdecec2849a132418284638fd520f3e16d74f8 (patch) | |
| tree | e7d3ec99f41e53833bb78da13aa6a6ba1a5dfc8b /engines/simon/items.cpp | |
| parent | 061063189ffc7ed0055cd88f3086dc0e236e2e68 (diff) | |
| download | scummvm-rg350-9bcdecec2849a132418284638fd520f3e16d74f8.tar.gz scummvm-rg350-9bcdecec2849a132418284638fd520f3e16d74f8.tar.bz2 scummvm-rg350-9bcdecec2849a132418284638fd520f3e16d74f8.zip | |
Add FF differences in chance script opcode
svn-id: r22068
Diffstat (limited to 'engines/simon/items.cpp')
| -rw-r--r-- | engines/simon/items.cpp | 37 |
1 files changed, 29 insertions, 8 deletions
diff --git a/engines/simon/items.cpp b/engines/simon/items.cpp index 03a7f90527..75c06faf2a 100644 --- a/engines/simon/items.cpp +++ b/engines/simon/items.cpp @@ -314,6 +314,7 @@ void SimonEngine::setupOpcodes() { opcode_table[190] = &SimonEngine::o2_waitMark; break; case GType_FF: + opcode_table[23] = &SimonEngine::o3_chance; opcode_table[37] = &SimonEngine::o3_jumpOut; opcode_table[65] = &SimonEngine::o3_addTextBox; opcode_table[70] = &SimonEngine::o3_printLongText; @@ -475,22 +476,22 @@ void SimonEngine::o_chance() { return; } - a += _scriptUnk1; + a += _chanceModifier; if (a <= 0) { - _scriptUnk1 = 0; + _chanceModifier = 0; setScriptCondition(false); } else if ((uint)_rnd.getRandomNumber(99) < a) { - if (_scriptUnk1 <= 0) - _scriptUnk1 -= 5; + if (_chanceModifier <= 0) + _chanceModifier -= 5; else - _scriptUnk1 = 0; + _chanceModifier = 0; setScriptCondition(true); } else { - if (_scriptUnk1 >= 0) - _scriptUnk1 += 5; + if (_chanceModifier >= 0) + _chanceModifier += 5; else - _scriptUnk1 = 0; + _chanceModifier = 0; setScriptCondition(false); } } @@ -1791,6 +1792,26 @@ void SimonEngine::o2_waitMark() { // Feeble Files Opcodes // ----------------------------------------------------------------------- +void SimonEngine::o3_chance() { + // 23 + uint a = getVarOrWord(); + + if (a == 0) { + setScriptCondition(false); + return; + } + + if (a == 100) { + setScriptCondition(true); + return; + } + + if ((uint)_rnd.getRandomNumber(99) < a) + setScriptCondition(true); + else + setScriptCondition(false); +} + void SimonEngine::o3_jumpOut() { // 37 getVarOrByte(); |
