LOL: implemented opcode required for magic wands

svn-id: r41016
This commit is contained in:
Florian Kagerer 2009-05-29 22:36:01 +00:00
parent 6668a3d796
commit 7463fe3f1b
3 changed files with 28 additions and 8 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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);