diff --git a/engines/zvision/actions.cpp b/engines/zvision/actions.cpp index 5af637f9bed6..2a795004270b 100644 --- a/engines/zvision/actions.cpp +++ b/engines/zvision/actions.cpp @@ -152,6 +152,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 e2e57c3a745c..bcd7848c10c1 100644 --- a/engines/zvision/actions.h +++ b/engines/zvision/actions.h @@ -211,6 +211,16 @@ class ActionEnableControl : public ResultAction { 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 5a96a569ecee..edb496a0eb8d 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)) {