aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorFlorian Kagerer2009-05-29 22:36:01 +0000
committerFlorian Kagerer2009-05-29 22:36:01 +0000
commit7463fe3f1b8355f8022a533a867aa74f71c2dc2d (patch)
tree618de6ecddafd6323754277bea88bf79541db754 /engines
parent6668a3d7964309fcc6b1790148a3814e4dd14c3f (diff)
downloadscummvm-rg350-7463fe3f1b8355f8022a533a867aa74f71c2dc2d.tar.gz
scummvm-rg350-7463fe3f1b8355f8022a533a867aa74f71c2dc2d.tar.bz2
scummvm-rg350-7463fe3f1b8355f8022a533a867aa74f71c2dc2d.zip
LOL: implemented opcode required for magic wands
svn-id: r41016
Diffstat (limited to 'engines')
-rw-r--r--engines/kyra/lol.cpp14
-rw-r--r--engines/kyra/lol.h1
-rw-r--r--engines/kyra/script_lol.cpp21
3 files changed, 28 insertions, 8 deletions
diff --git a/engines/kyra/lol.cpp b/engines/kyra/lol.cpp
index 6a2ab1b571..a5abd5395b 100644
--- a/engines/kyra/lol.cpp
+++ b/engines/kyra/lol.cpp
@@ -2340,18 +2340,18 @@ void LoLEngine::processMagicFireball(int charNum, int spellLevel) {
_screen->copyPage(0, 12);
int fireBallWH = (d << 4) * -1;
- int numFireBalls = 1;
+ int numFireballs = 1;
if (fbCnt > 3)
- numFireBalls = fbCnt - 3;
+ numFireballs = fbCnt - 3;
FireballState *fireballState[3];
memset(fireballState, 0, sizeof(fireballState));
- for (i = 0; i < numFireBalls; i++)
+ for (i = 0; i < numFireballs; i++)
fireballState[i] = new FireballState(i);
_screen->copyPage(12, drawPage1);
- for (i = 0; i < numFireBalls;) {
+ for (i = 0; i < numFireballs;) {
_screen->setCurPage(drawPage1);
uint32 ctime = _system->getMillis();
@@ -2407,8 +2407,8 @@ void LoLEngine::processMagicFireball(int charNum, int spellLevel) {
i++;
}
- static const uint8 fireBallSfx[] = { 98, 167, 167, 168 };
- snd_playSoundEffect(fireBallSfx[d], -1);
+ static const uint8 fireballSfx[] = { 98, 167, 167, 168 };
+ snd_playSoundEffect(fireballSfx[d], -1);
} else {
fb->progress -= fb->step;
@@ -2426,7 +2426,7 @@ void LoLEngine::processMagicFireball(int charNum, int spellLevel) {
_screen->copyPage(12, drawPage1);
}
- for (i = 0; i < numFireBalls; i++)
+ for (i = 0; i < numFireballs; i++)
delete fireballState[i];
_screen->setCurPage(cp);
diff --git a/engines/kyra/lol.h b/engines/kyra/lol.h
index b0a41eded7..90bd8643f5 100644
--- a/engines/kyra/lol.h
+++ b/engines/kyra/lol.h
@@ -740,6 +740,7 @@ private:
int olol_paralyzePoisonCharacter(EMCState *script);
int olol_drawCharPortrait(EMCState *script);
int olol_assignSpecialGuiShape(EMCState *script);
+ int olol_changeItemTypeOrFlag(EMCState *script);
int olol_placeInventoryItemInHand(EMCState *script);
int olol_castSpell(EMCState *script);
int olol_pitDrop(EMCState *script);
diff --git a/engines/kyra/script_lol.cpp b/engines/kyra/script_lol.cpp
index d1c24c9acf..c0292425cd 100644
--- a/engines/kyra/script_lol.cpp
+++ b/engines/kyra/script_lol.cpp
@@ -1882,6 +1882,25 @@ int LoLEngine::olol_assignSpecialGuiShape(EMCState *script) {
return 1;
}
+int LoLEngine::olol_changeItemTypeOrFlag(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "LoLEngine::olol_changeItemTypeOrFlag(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
+ if (stackPos(0) < 1)
+ return 0;
+
+ ItemInPlay *i = &_itemsInPlay[stackPos(0)];
+ int r = stackPos(2) & 0x1fff;
+
+ if (stackPos(1) == 4) {
+ i->itemPropertyIndex = r;
+ return r;
+ } else if (stackPos(1) == 15) {
+ i->shpCurFrame_flg = (i->shpCurFrame_flg & 0xe000) | r;
+ return r;
+ }
+
+ return -1;
+}
+
int LoLEngine::olol_placeInventoryItemInHand(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "LoLEngine::olol_placeInventoryItemInHand(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
int itemType = stackPos(0);
@@ -2523,7 +2542,7 @@ void LoLEngine::setupOpcodeTable() {
OpcodeUnImpl();
OpcodeUnImpl();
OpcodeUnImpl();
- OpcodeUnImpl();
+ Opcode(olol_changeItemTypeOrFlag);
// 0xAC
Opcode(olol_placeInventoryItemInHand);