aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/kyra/kyra_v3.cpp5
-rw-r--r--engines/kyra/kyra_v3.h2
-rw-r--r--engines/kyra/script_v3.cpp16
3 files changed, 20 insertions, 3 deletions
diff --git a/engines/kyra/kyra_v3.cpp b/engines/kyra/kyra_v3.cpp
index c08d75fb24..017594b459 100644
--- a/engines/kyra/kyra_v3.cpp
+++ b/engines/kyra/kyra_v3.cpp
@@ -999,7 +999,10 @@ void KyraEngine_v3::runLoop() {
_runFlag = true;
while (_runFlag && !_quitFlag) {
- //XXX deathHandler
+ if (_deathHandler >= 0) {
+ // TODO: add menu etc.
+ loadGame(getSavegameFilename(999));
+ }
if (_system->getMillis() >= _nextIdleAnim)
showIdleAnim();
diff --git a/engines/kyra/kyra_v3.h b/engines/kyra/kyra_v3.h
index cdbdc11998..cc7fab388a 100644
--- a/engines/kyra/kyra_v3.h
+++ b/engines/kyra/kyra_v3.h
@@ -735,6 +735,7 @@ private:
int o3_setMalcolmsMood(ScriptState *script);
int o3_delay(ScriptState *script);
int o3_updateScore(ScriptState *script);
+ int o3_makeSecondChanceSave(ScriptState *script);
int o3_setSceneFilename(ScriptState *script);
int o3_removeItemsFromScene(ScriptState *script);
int o3_disguiseMalcolm(ScriptState *script);
@@ -758,6 +759,7 @@ private:
int o3_blockOutRegion(ScriptState *script);
int o3_showSceneStringsMessage(ScriptState *script);
int o3_getRand(ScriptState *script);
+ int o3_setDeathHandler(ScriptState *script);
int o3_waitForConfirmationClick(ScriptState *script);
int o3_defineRoomEntrance(ScriptState *script);
int o3_runTemporaryScript(ScriptState *script);
diff --git a/engines/kyra/script_v3.cpp b/engines/kyra/script_v3.cpp
index 2eb141310a..574c105481 100644
--- a/engines/kyra/script_v3.cpp
+++ b/engines/kyra/script_v3.cpp
@@ -442,6 +442,12 @@ int KyraEngine_v3::o3_updateScore(ScriptState *script) {
return updateScore(stackPos(0), stackPos(1)) ? 1 : 0;
}
+int KyraEngine_v3::o3_makeSecondChanceSave(ScriptState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_makeSecondChanceSave(%p) ()", (const void *)script);
+ saveGame(getSavegameFilename(999), "SECOND CHANCE SAVE GAME");
+ return 0;
+}
+
int KyraEngine_v3::o3_setSceneFilename(ScriptState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_setSceneFilename(%p) (%d, '%s')", (const void *)script, stackPos(0), stackPosString(1));
strcpy(_sceneList[stackPos(0)].filename1, stackPosString(1));
@@ -919,6 +925,12 @@ int KyraEngine_v3::o3_getRand(ScriptState *script) {
return _rnd.getRandomNumberRng(stackPos(0), stackPos(1));
}
+int KyraEngine_v3::o3_setDeathHandler(ScriptState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_setDeathHandler(%p) (%d)", (const void *)script, stackPos(0));
+ _deathHandler = stackPos(0);
+ return 0;
+}
+
int KyraEngine_v3::o3_waitForConfirmationClick(ScriptState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o2_waitForConfirmationClick(%p) (%d)", (const void *)script, stackPos(0));
resetSkipFlag();
@@ -1417,7 +1429,7 @@ void KyraEngine_v3::setupOpcodeTable() {
Opcode(o3_delay);
// 0x38
Opcode(o3_updateScore);
- OpcodeUnImpl();
+ Opcode(o3_makeSecondChanceSave);
Opcode(o3_setSceneFilename);
OpcodeUnImpl();
// 0x3c
@@ -1468,7 +1480,7 @@ void KyraEngine_v3::setupOpcodeTable() {
// 0x60
Opcode(o3_getRand);
Opcode(o3_dummy);
- OpcodeUnImpl();
+ Opcode(o3_setDeathHandler);
OpcodeUnImpl();
// 0x64
OpcodeUnImpl();