aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorTravis Howell2006-04-21 07:42:40 +0000
committerTravis Howell2006-04-21 07:42:40 +0000
commit9bcdecec2849a132418284638fd520f3e16d74f8 (patch)
treee7d3ec99f41e53833bb78da13aa6a6ba1a5dfc8b /engines
parent061063189ffc7ed0055cd88f3086dc0e236e2e68 (diff)
downloadscummvm-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')
-rw-r--r--engines/simon/items.cpp37
-rw-r--r--engines/simon/simon.cpp2
-rw-r--r--engines/simon/simon.h3
3 files changed, 32 insertions, 10 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();
diff --git a/engines/simon/simon.cpp b/engines/simon/simon.cpp
index a9f3bed8a3..9adff9ef75 100644
--- a/engines/simon/simon.cpp
+++ b/engines/simon/simon.cpp
@@ -207,7 +207,7 @@ SimonEngine::SimonEngine(OSystem *syst)
_oldMouseAnimMax = 0;
_vgaVar9 = 0;
- _scriptUnk1 = 0;
+ _chanceModifier = 0;
_restoreWindow6 = 0;
_scrollX = 0;
_scrollY = 0;
diff --git a/engines/simon/simon.h b/engines/simon/simon.h
index 2fd6cf720b..b26156e9de 100644
--- a/engines/simon/simon.h
+++ b/engines/simon/simon.h
@@ -264,7 +264,7 @@ protected:
bool _subtitles;
bool _fade;
bool _vgaVar9;
- int16 _scriptUnk1;
+ int16 _chanceModifier;
bool _restoreWindow6;
int _scrollX, _scrollXMax, _scrollWidth;
int _scrollY, _scrollYMax, _scrollHeight;
@@ -971,6 +971,7 @@ public:
void o2_waitMark();
// Opcodes, Feeble Files only
+ void o3_chance();
void o3_jumpOut();
void o3_addTextBox();
void o3_printLongText();