[Scummvm-cvs-logs] SF.net SVN: scummvm: [22068] scummvm/trunk/engines/simon
kirben at users.sourceforge.net
kirben at users.sourceforge.net
Fri Apr 21 00:43:13 CEST 2006
Revision: 22068
Author: kirben
Date: 2006-04-21 00:42:40 -0700 (Fri, 21 Apr 2006)
ViewCVS: http://svn.sourceforge.net/scummvm/?rev=22068&view=rev
Log Message:
-----------
Add FF differences in chance script opcode
Modified Paths:
--------------
scummvm/trunk/engines/simon/items.cpp
scummvm/trunk/engines/simon/simon.cpp
scummvm/trunk/engines/simon/simon.h
Modified: scummvm/trunk/engines/simon/items.cpp
===================================================================
--- scummvm/trunk/engines/simon/items.cpp 2006-04-21 06:37:28 UTC (rev 22067)
+++ scummvm/trunk/engines/simon/items.cpp 2006-04-21 07:42:40 UTC (rev 22068)
@@ -314,6 +314,7 @@
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 @@
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 @@
// 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();
Modified: scummvm/trunk/engines/simon/simon.cpp
===================================================================
--- scummvm/trunk/engines/simon/simon.cpp 2006-04-21 06:37:28 UTC (rev 22067)
+++ scummvm/trunk/engines/simon/simon.cpp 2006-04-21 07:42:40 UTC (rev 22068)
@@ -207,7 +207,7 @@
_oldMouseAnimMax = 0;
_vgaVar9 = 0;
- _scriptUnk1 = 0;
+ _chanceModifier = 0;
_restoreWindow6 = 0;
_scrollX = 0;
_scrollY = 0;
Modified: scummvm/trunk/engines/simon/simon.h
===================================================================
--- scummvm/trunk/engines/simon/simon.h 2006-04-21 06:37:28 UTC (rev 22067)
+++ scummvm/trunk/engines/simon/simon.h 2006-04-21 07:42:40 UTC (rev 22068)
@@ -264,7 +264,7 @@
bool _subtitles;
bool _fade;
bool _vgaVar9;
- int16 _scriptUnk1;
+ int16 _chanceModifier;
bool _restoreWindow6;
int _scrollX, _scrollXMax, _scrollWidth;
int _scrollY, _scrollYMax, _scrollHeight;
@@ -971,6 +971,7 @@
void o2_waitMark();
// Opcodes, Feeble Files only
+ void o3_chance();
void o3_jumpOut();
void o3_addTextBox();
void o3_printLongText();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list