From 5d29112f1c06dea3a789b36b0d109e6529f8cd61 Mon Sep 17 00:00:00 2001 From: Ľubomír Remák Date: Tue, 6 Mar 2018 22:48:54 +0100 Subject: MUTATIONOFJB: Add say command with dummy implementation. --- engines/mutationofjb/commands/endblockcommand.cpp | 2 +- engines/mutationofjb/commands/ifcommand.cpp | 19 +++ engines/mutationofjb/commands/saycommand.cpp | 151 ++++++++++++++++++++++ engines/mutationofjb/commands/saycommand.h | 56 ++++++++ engines/mutationofjb/commands/seqcommand.cpp | 2 +- engines/mutationofjb/commands/seqcommand.h | 2 +- engines/mutationofjb/module.mk | 1 + engines/mutationofjb/script.cpp | 2 + 8 files changed, 232 insertions(+), 3 deletions(-) create mode 100644 engines/mutationofjb/commands/saycommand.cpp create mode 100644 engines/mutationofjb/commands/saycommand.h (limited to 'engines') diff --git a/engines/mutationofjb/commands/endblockcommand.cpp b/engines/mutationofjb/commands/endblockcommand.cpp index be610c7c9a..af9282f81c 100644 --- a/engines/mutationofjb/commands/endblockcommand.cpp +++ b/engines/mutationofjb/commands/endblockcommand.cpp @@ -102,7 +102,7 @@ void EndBlockCommandParser::transition(ScriptParseContext &parseCtx, Command *, } if (!_pendingActionInfos.empty() && newCommandParser != this) { - debug("Fixing pending action info.\n"); + debug("Fixing pending action info."); for (Common::Array::iterator it = _pendingActionInfos.begin(); it != _pendingActionInfos.end(); ++it) { (*it)->_command = newCommand; } diff --git a/engines/mutationofjb/commands/ifcommand.cpp b/engines/mutationofjb/commands/ifcommand.cpp index a41875f33b..0643c3e161 100644 --- a/engines/mutationofjb/commands/ifcommand.cpp +++ b/engines/mutationofjb/commands/ifcommand.cpp @@ -26,6 +26,25 @@ #include "common/str.h" #include "common/translation.h" +/* + "IF" ["!"] + + IF command compares the value of the WX pseudo-register of the object in the specified scene. + If the values match, execution continues to the next line. + Otherwise execution continues after first "#ELSE" with the same . + The logic can be reversed with exclamation mark at the end. + + is always 1 character long, and 2 characters long. + + Please note that this does not work line you are used to from saner languages. + IF does not have any blocks. It only searches for first #ELSE, so you can have stuff like: + IF something + IF something else + #ELSE + ... + This is effectively logical AND. +*/ + namespace MutationOfJB { bool IfCommandParser::parse(const Common::String &line, ScriptParseContext &parseContext, Command *&command) { diff --git a/engines/mutationofjb/commands/saycommand.cpp b/engines/mutationofjb/commands/saycommand.cpp new file mode 100644 index 0000000000..9448203911 --- /dev/null +++ b/engines/mutationofjb/commands/saycommand.cpp @@ -0,0 +1,151 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "mutationofjb/commands/saycommand.h" +#include "mutationofjb/script.h" +#include "common/str.h" +#include "common/debug.h" +#include "common/debug-channels.h" + +/* + ("SM" | "SLM" | "NM" | "NLM") " " ["<" | " " " ("<" | "