mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-08 03:47:32 +00:00
Implemented opcodes:
- 76: o3_removeItemInstances - 94: o3_showSceneStringsMessage svn-id: r31733
This commit is contained in:
parent
3bde19a137
commit
2ae81f0096
@ -716,6 +716,7 @@ private:
|
||||
int o3_updateConversations(ScriptState *script);
|
||||
int o3_setSceneDim(ScriptState *script);
|
||||
int o3_update(ScriptState *script);
|
||||
int o3_removeItemInstances(ScriptState *script);
|
||||
int o3_enterNewScene(ScriptState *script);
|
||||
int o3_setMalcolmPos(ScriptState *script);
|
||||
int o3_stopMusic(ScriptState *script);
|
||||
@ -723,6 +724,7 @@ private:
|
||||
int o3_playSoundEffect(ScriptState *script);
|
||||
int o3_getScore(ScriptState *script);
|
||||
int o3_blockOutRegion(ScriptState *script);
|
||||
int o3_showSceneStringsMessage(ScriptState *script);
|
||||
int o3_getRand(ScriptState *script);
|
||||
int o3_waitForConfirmationClick(ScriptState *script);
|
||||
int o3_defineRoomEntrance(ScriptState *script);
|
||||
|
@ -689,6 +689,34 @@ int KyraEngine_v3::o3_update(ScriptState *script) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int KyraEngine_v3::o3_removeItemInstances(ScriptState *script) {
|
||||
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_removeItemInstances(%p) (%d)", (const void *)script, stackPos(0));
|
||||
const int16 item = stackPos(0);
|
||||
|
||||
int deleted = 0;
|
||||
|
||||
for (int i = 0; i < 10; ++i) {
|
||||
if (_mainCharacter.inventory[i] == item) {
|
||||
_mainCharacter.inventory[i] = 0xFFFF;
|
||||
++deleted;
|
||||
}
|
||||
}
|
||||
|
||||
if (_itemInHand == item) {
|
||||
removeHandItem();
|
||||
++deleted;
|
||||
}
|
||||
|
||||
for (int i = 0; i < 50; ++i) {
|
||||
if (_itemList[i].id == item) {
|
||||
_itemList[i].id = 0xFFFF;
|
||||
++deleted;
|
||||
}
|
||||
}
|
||||
|
||||
return deleted;
|
||||
}
|
||||
|
||||
int KyraEngine_v3::o3_enterNewScene(ScriptState *script) {
|
||||
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_enterNewScene(%p) (%d, %d, %d, %d, %d)", (const void *)script, stackPos(0),
|
||||
stackPos(1), stackPos(2), stackPos(3), stackPos(4));
|
||||
@ -759,6 +787,12 @@ int KyraEngine_v3::o3_blockOutRegion(ScriptState *script) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int KyraEngine_v3::o3_showSceneStringsMessage(ScriptState *script) {
|
||||
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_showSceneStringsMessage(%p) (%d)", (const void *)script, stackPos(0));
|
||||
showMessage((const char*)getTableEntry(_sceneStrings, stackPos(0)), 0xFF, 0xF0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int KyraEngine_v3::o3_getRand(ScriptState *script) {
|
||||
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_getRand(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
|
||||
assert(stackPos(0) < stackPos(1));
|
||||
@ -1281,7 +1315,7 @@ void KyraEngine_v3::setupOpcodeTable() {
|
||||
OpcodeUnImpl();
|
||||
Opcode(o3_update);
|
||||
// 0x4c
|
||||
OpcodeUnImpl();
|
||||
Opcode(o3_removeItemInstances);
|
||||
OpcodeUnImpl();
|
||||
OpcodeUnImpl();
|
||||
OpcodeUnImpl();
|
||||
@ -1303,7 +1337,7 @@ void KyraEngine_v3::setupOpcodeTable() {
|
||||
// 0x5c
|
||||
Opcode(o3_blockOutRegion);
|
||||
Opcode(o3_dummy);
|
||||
OpcodeUnImpl();
|
||||
Opcode(o3_showSceneStringsMessage);
|
||||
OpcodeUnImpl();
|
||||
// 0x60
|
||||
Opcode(o3_getRand);
|
||||
|
Loading…
x
Reference in New Issue
Block a user