aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/zvision/actions.cpp40
-rw-r--r--engines/zvision/actions.h10
-rw-r--r--engines/zvision/scr_file_handling.cpp2
3 files changed, 51 insertions, 1 deletions
diff --git a/engines/zvision/actions.cpp b/engines/zvision/actions.cpp
index 5af637f9be..2a79500427 100644
--- a/engines/zvision/actions.cpp
+++ b/engines/zvision/actions.cpp
@@ -153,6 +153,46 @@ bool ActionEnableControl::execute() {
//////////////////////////////////////////////////////////////////////////////
+// ActionKill
+//////////////////////////////////////////////////////////////////////////////
+
+ActionKill::ActionKill(ZVision *engine, const Common::String &line) :
+ ResultAction(engine) {
+ _key = 0;
+ _type = 0;
+ char keytype[25];
+ sscanf(line.c_str(), "%*[^(](%25s)", keytype);
+ if (keytype[0] == '"') {
+ if (!scumm_stricmp(keytype, "\"ANIM\""))
+ _type = SideFX::SIDEFX_ANIM;
+ else if (!scumm_stricmp(keytype, "\"AUDIO\""))
+ _type = SideFX::SIDEFX_AUDIO;
+ else if (!scumm_stricmp(keytype, "\"DISTORT\""))
+ _type = SideFX::SIDEFX_DISTORT;
+ else if (!scumm_stricmp(keytype, "\"PANTRACK\""))
+ _type = SideFX::SIDEFX_PANTRACK;
+ else if (!scumm_stricmp(keytype, "\"REGION\""))
+ _type = SideFX::SIDEFX_REGION;
+ else if (!scumm_stricmp(keytype, "\"TIMER\""))
+ _type = SideFX::SIDEFX_TIMER;
+ else if (!scumm_stricmp(keytype, "\"TTYTEXT\""))
+ _type = SideFX::SIDEFX_TTYTXT;
+ else if (!scumm_stricmp(keytype, "\"ALL\""))
+ _type = SideFX::SIDEFX_ALL;
+ } else
+ _key = atoi(keytype);
+}
+
+bool ActionKill::execute() {
+ if (_type)
+ _engine->getScriptManager()->killSideFxType((SideFX::SideFXType)_type);
+ else
+ _engine->getScriptManager()->killSideFx(_key);
+ return true;
+}
+
+
+//////////////////////////////////////////////////////////////////////////////
// ActionMusic
//////////////////////////////////////////////////////////////////////////////
diff --git a/engines/zvision/actions.h b/engines/zvision/actions.h
index e2e57c3a74..bcd7848c10 100644
--- a/engines/zvision/actions.h
+++ b/engines/zvision/actions.h
@@ -211,6 +211,16 @@ private:
uint32 _key;
};
+class ActionKill : public ResultAction {
+public:
+ ActionKill(ZVision *engine, const Common::String &line);
+ bool execute();
+
+private:
+ uint32 _key;
+ uint32 _type;
+};
+
class ActionMusic : public ResultAction {
public:
ActionMusic(ZVision *engine, const Common::String &line);
diff --git a/engines/zvision/scr_file_handling.cpp b/engines/zvision/scr_file_handling.cpp
index 5a96a569ec..edb496a0eb 100644
--- a/engines/zvision/scr_file_handling.cpp
+++ b/engines/zvision/scr_file_handling.cpp
@@ -199,7 +199,7 @@ void ScriptManager::parseResults(Common::SeekableReadStream &stream, Common::Lis
} else if (line.matchString("*:inventory*", true)) {
// TODO: Implement ActionInventory
} else if (line.matchString("*:kill*", true)) {
- // TODO: Implement ActionKill
+ actionList.push_back(new ActionKill(_engine, line));
} else if (line.matchString("*:menu_bar_enable*", true)) {
// TODO: Implement ActionMenuBarEnable
} else if (line.matchString("*:music*", true)) {